users@glassfish.java.net

[gf-users] Re: Glassfish JDBC Connection Pool property question

From: Reza Rahman <Reza.Rahman_at_oracle.com>
Date: Fri, 11 Jul 2014 17:27:49 -0400

Responses in-line:

On 7/11/2014 5:10 PM, Noah White wrote:
> Hi Reza:
>
> So I have some EJBs which are annotated with @TransactionAttribute(TransactionAttribute.NOT_SUPPORTED) , they make read-only calls to the DB, and they run without throwing any exceptions whether or not this box is checked off so my question is basically two fold:
>
> 1. Whats the purpose of this setting? (The User’s Guide doesn’t give anymore detail then the GUI does)

It is basically saying that the connection will not participate in a
transaction (likely either JTA or local).

> 2. What are the expectations in this case? (So I can determine if this is expected or a bug)

That really depends on the entity manager you are using. Assuming you
are using a transaction scoped managed JPA object it will allow you to
do read operations without a transaction and throw an exception otherwise.

>
> Thanks,
>
> -Noah
>
> On Jul 11, 2014, at 4:56 PM, Reza Rahman <Reza.Rahman_at_oracle.com> wrote:
>
>> The best approach is probably to write a test and see what happens. My guess is that the entity manager will throw an exception if you try to do anything that requires an active transaction. Otherwise you'll probably be fine.
>>
>> On 7/11/2014 4:44 PM, Noah White wrote:
>>> In the a JDBC Connection Pool there’s a Transaction section which has a property called “Non Transactional Connection” and a check box next to the word “Enabled”. The caption to this property says, “Returns non-transactional connections”.
>>>
>>> If the Enabled box is NOT checked off, what happens with respect to EJB’s that have methods annotated with @TransactionAttribute(TransactionAttribute.NOT_SUPPORTED) or .NEVER and whose injected EntityManager is associated with a Persistence units what is a JTA resources that uses this connection pool?
>>>
>>> -Noah