tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: JDBC Transactions vs EJBs and @TransactionAttribute(...) and more...
Date Tue, 14 Oct 2014 23:03:18 GMT

this is actually more bound to JTA (you can read

2014-10-15 0:14 GMT+02:00 Lars-Fredrik Smedberg <>:
> 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
> 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, and destroy all copies of this
> message and any attachments.

View raw message