Atomikos Forum

How to set driver properties

My driver -- Data Direct -- defaults to autocommit=true and transaction isolation=1. The only way that I've been able to change that is to wrap the AtomikosDataSourceBean with my own class that overrides getConnection(). However, this means that the test command is executed in a local transaction so I can't use it.

I can't help but to think that there's a better way to set the isolation level and autocommit on my driver than this.

Is there?
Les Walker Send private email
Wednesday, June 17, 2009
 
 
Hi,

Can't you set this on the DataDirect XADataSource?

Guy
Guy Pardon Send private email
Thursday, June 18, 2009
 
 
You would think so, but I've looked at the unwrapped data source supplied by the vendor and I cannot find a way to do it. I have a ticket open with them though.
Les Walker Send private email
Thursday, June 18, 2009
 
 
Okay, AutoCommit is not an issue. It appears that most driver developers ignore autocommit once an XA transaction is going on a connection which is kinda nice because you can do autocommit stuff when you need to on the same connection.

The isolation is more difficult.

If you look at the Hibernate code you'll find that isolation is set in the DriverManagerConnectionProvider but not in the DataSourceConnectionProvider. I think that's a mistake. It really ought to be done in the DataSourceConnectionProvider. However, Atomikos uses the AtomikosConnectionProvider instead of the DataSourceConnection Provider.

I should be pretty simple to add code to the AtomikosConnectionProvider to act on the hibernate hibernate.connection.isolation property when a new connection is retrieved from the pool

If the changes are indeed as small as I think they are would you merge this into your next release?
Les Walker Send private email
Friday, June 19, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics