[Design of JCA on JBoss] - Re: Allow setAutoCommit(false) on managed connections
by bill.burke@jboss.com
I don't think you are listening to me. connection.commit() /rollback()SHOULD fail as it is a state change. setAutoCommit(false) should succeed as there is no state change to the connection if auto commit is already false.
Thirdparty code may not be doing commit(), rollback(), but may only be doing setAutoCommit(false). Which should be perfectly fine, again, because there is no state change to the connection. This could be what the user is running into. I don't know.
Weston/myself had similar spec religiousness debates with Mark Little around allowing multiple non-XA resources in a transaction.
Morale of the story? You may know something is wrong and not the right way to do it, but there may be no other way because you don't control all the variables.
Anyways, since I am not coding any of this, doesn't really matter what I think....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067069#4067069
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067069
18 years, 8 months
[Design of JCA on JBoss] - Re: Allow setAutoCommit(false) on managed connections
by adrian@jboss.org
"bill.burke(a)jboss.com" wrote : Adrian, you're sounding too much like Mark Little
|
That's a complement :-)
anonymous wrote :
| setAutomCommit(false); does not change the transactional characteristics of the connection because autoCommit is already false.
We're not talking about the state of the connection, we're talking about when the
commit occurs. Is it, where my code assumes it is in the example I posted above
or is in the JTA transaction demarcation after the method ends (breaking my code!).
By breaking my code, I mean I start another transaction on the connection
or I do something else that requires the transaction committed succesfully.
| The problem the user is having is that he wants to invoke thirdparty code that he cannot control, with a JTA/JCA managed connection within a transaction.
|
This is broken. I'm not going to break other people's code to make this work
(or more likely lead them to make the same mistakes).
It will also lead to non-portable code. Other appservers won't run it.
If you want to introduce a ManagedConnectionFactory property that does
| setIgnoreAutoCommitInManagedConnection(true);
|
then go ahead. But it needs to be false by default and come with a big
health warning about setting it to true.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067033#4067033
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067033
18 years, 8 months