>With this coding style, when would the resources associated with the
>connections get enlisted with the transaction manager and associated with
>the transaction? If the container interposes on the getConnection, it can
>enlist the resources with the transaction manager, but can it do it before
>the transaction is started? Certainly, the JDBC driver isn't going to do
>it in the Statement implementation.
I would think that if you wanted your connection enrolled in the
transaction, you would write them inside
the transaction code, that would the more logical course of action (my Spoc
side talking I suppose).
>Other than the above issue, I can see how you would want to code it as in
>the example. It moves the potentially time consuming connection code out
of
>the transaction.
As I would suppose that most containers will use connection pooling, I don't
think that this last statement is very correct.
One could of course surmise that a really inteligent container would
postpone the actual creation (or getting) of a connection until the latest
possible moment. In this case it would return a "dummy" handle in the
initial "getConnection" statement, and only take a connection at the moment
when it can't do otherwise i.e. when calling "executeQuery", it would then
see it needs a connection, enroll it in the TX, etc. . This would of course
require a complete wrappering of all JDBC objects.
Michael Moerman
THE CAPITAL MARKETS COMPANY
<mailto:[EMAIL PROTECTED]>
<http://www.capitalmarketscompany.com>
tel. + 32 495 58 88 46
fax + 32 3 821 14 12
*********************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
The Capital Markets Company.
http://www.capitalmarketscompany.com
***********************************************************************
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".