SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-324
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Alexey Kharlamov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

Compass should not try to manage auto-commit mode in a managed mode

Created: 01/Dec/06 02:47 AM   Updated: 05/Dec/06 12:09 PM
Component/s: Compass::Core
Affects Version/s: 1.1 M3
Fix Version/s: 1.1 RC1

Environment: JBoss 4.0.4, MySQL Connect/J 5.0.4, JTA


 Description  « Hide
Compass try to manage connection auto-commit mode on a datasource obtained from JNDI in managed mode.
Even if the autocommit set to false, this action injures jboss datasource management code. So consequent commit on the JTA transaction fails.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 01/Dec/06 10:43 AM
Here is the code from Compass JndiDataSourceProvider:

if (conn.getAutoCommit() != autoCommit) { conn.setAutoCommit(autoCommit); }

So, the autoCommit is set only oif it differs from the one the connection is set with. Does JBoss acts in some peculiar way that breaks it?


Alexey Kharlamov added a comment - 01/Dec/06 11:07 AM
Yes, may be the problem is JBoss specific. It seems autoCommit property on datasource outside a transaction scope is always true. Moreover, if the JndiDataSourceProvider sets it to false, the subsequent transactions fails reporting autocommit was set to true.

So the problem may be caused by an inconsistency in JBoss datasource management. However, I suppose it is not good idea to change connection's properties in a managed mode anyway. The same connection may be used by another parties (Hibernate, JDBC, JMS and so force). They will expect a connection with original properties defined by datasource description.


Shay Banon added a comment - 05/Dec/06 12:09 PM
autoCommit now allows to have three values: false, true, and external (won't set the autoCommit value).