Hi this is actually more bound to JTA (you can read http://svn.apache.org/repos/asf/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/managed/local/ManagedConnection.java)
2014-10-15 0:14 GMT+02:00 Lars-Fredrik Smedberg <[email protected]>: > Hi > > Using JDBC, creating a connection and setting it to auto commit false to be > able to group more than one statement into a single transaction I > understand. > > - Is it possible to compare that to an EJB with a @TransactionAttribute > set? I would like to understand more in detail how the EJB handles > transactions, datasources and connections "under the hood". > (it all comes from a discussion with a DBA) > > If I use @Resource to inject a Datasource and use to retrieve a connection > I usually call close on it after I done using it, > > - Will close on the connection actually close it or is that done at the > commit of the transaction (assume we are in an EJB with > @TransactionAttribute set)? will be done later to support rollback > - Will the container automatically set auto commit false to any connections > retrieved within the transaction? all JTA ones, can also depend on JPA provider config > - ... and many more questions :) > > Maybe I'm mixing the topics a bit but it would be really great to > understand it all more in-depth to be able to have the understanding and > discuss it with the DBA. > > Thanks > > > > -- > Med vänlig hälsning / Best regards > > Lars-Fredrik Smedberg > > STATEMENT OF CONFIDENTIALITY: > The information contained in this electronic message and any > attachments to this message are intended for the exclusive use of the > address(es) and may contain confidential or privileged information. If > you are not the intended recipient, please notify Lars-Fredrik Smedberg > immediately at [email protected], and destroy all copies of this > message and any attachments.
