atomikos / transactions-essentials

Development repository for next major release of
https://www.atomikos.com/Main/TransactionsEssentials
Other
462 stars 139 forks source link

Add support for connection-INIT-SQL property #190

Closed AlGolUA closed 1 year ago

AlGolUA commented 1 year ago

This is a widely used requirement to use credentials other than the schema owner's credentials to connect to the database or call something right after connection. connection-INIT-SQL property, that can look like, connection-INIT-SQL = BEGIN EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = MAIN'; END; allows you to achieve this goal for Hikary pool. But it looks like the Atomikos library doesn't support anything like that. For now we have to extend AtomikosDataSourceBean and its getConnection method by making required initialization and keeping hashCode of initialized connection in internal map (to avoid double initialization and to clear the map from old items).

GuyPardon commented 1 year ago

Thanks. The requirement is not that widely used because we only had one request for it so far, this being the second maybe?

AlGolUA commented 1 year ago

Looking for solution I have found just one question by the same topic on stackoverflow: Atomikos equivalent to Hikari connection-init-sql. In any case it could be a nice extention, but lets wait for voting.

GuyPardon commented 1 year ago

Ah, if that's what you mean then I can tell you we have such a feature in our commercial distribution. There's a free trial if you are interested.