1. You might want to check the DBTM working group at
http://www.enhydra.org/community/workingGroups/DBTM.html. But, reading the
1.6.1 source, it looks to me like JOnAS does indeed pool connections; each
JDBC DataSource you list in jonas.properties gets its own pool. (It's in the
jta.ConnectionManager, which is what the jdbc: connections map to). When you
call close(), all that happens is that the wrapper notifies the XAConnection
impl that you are done, so the transaction manager can go about its business
of finishing the transaction and letting the ConnectionManager return the
underlying Connection to the pool. (This machinery will probably change
soon: Christophe Ney is working on combining some nice error handling from
the Enhydra connection pool manager with the XA-style pooling from JOnAS, to
make a database connection pool service that both the EJB and Web Containers
will use)
2. TX_REQUIRED tells me you mean a CMT bean; so, see Table 7 (page 177) of
the EJB 1.1 spec. In this case, you have started a transaction with
trans.begin() in the client - let's call that transaction context T1. Now,
T1 will be used by UpdateData() and by all resource managers used by
UpdateData. Further, suppose Bean.UpdateData invoke another EJB - then,
transaction propagation carries T1 to that bean or XAResource, where the
deployment transactional attribute will govern whether T1 is used (REQUIRED,
SUPPORTS, MANDATORY), suspended (NOT_SUPPORTED, REQUIRES_NEW), or causes an
error (NEVER). Further, suppose that the client does more work with
XAResources or EJBs betweem the UpdateData return and the trans.rollback; in
this case again, T1 is the transaction context.
When you call trans.rollback, the transaction manager will notify all
enlisted XAResources to drop T1, so all the work done in that context will
be cancelled - even if it applies to multiple tables. With XA-compliant
drivers, this happens even if the work spans different XAResources.
As an aside, note that even if you call trans.commit the transaction will
rollback if any of the participants called markRollbackOnly.
Wayne Stidolph
Lutris Technologies
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Sundar Seshadri
> Sent: Monday, March 06, 2000 10:19 AM
> To: [EMAIL PROTECTED]
> Subject: Connection pooling & transaction
>
>
> Hello
>
> We are implementing Entity Beans with Bean Managed Persistence using the
> Jonas
> Web application server. I have a couple of questions:
>
> 1. Does Jonas EJB Server support connection pooling? What happens behind
> the scene
> when the following statement is invoked from within a Bean code:
>
> conn.close(); // For closing a db connection.
>
> 2. How are transactions handled when I set the transaction attribute to
> be
> TX_REQUIRED.
>
> For example, suppose I have a client that has the following code:
>
> trans.begin(); // To being a transaction
> Bean.UpdateData(); // To perform some updates to the bean, which in
> turn updates
> // the database using ejbStore()
> trans.rollback(); // To rollback the transaction
>
> In the above case, would all updates made within the UpdateData()
> method be
> rolledback? How would it work when I have multiple database tables
> updated from
> within the bean?
>
> Thanks for any info.
>
> Sundar
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".