Consider the following snippet in a BMT session bean:
1. In the above code instead of connection.close() can I do a connection.commit()? If it is legal, will the c1.commit() be permanent even if c2.commit() fails?
2.DataSource API says:
The DataSource interface is implemented by a driver vendor. There are three types of implementations:
1. Basic implementation -- produces a standard Connection object 2. Connection pooling implementation -- produces a Connection object that will automatically participate in connection pooling. This implementation works with a middle-tier connection pooling manager. 3. Distributed transaction implementation -- produces a Connection object that may be used for distributed transactions and almost always participates in connection pooling. This implementation works with a middle-tier transaction manager and almost always with a connection pooling manager.
If you have the 3rd type of implementation in your driver then the above code snippet will work fine, but if you have type 1 or 2 implementation then is it possible that c1 commits and c2 does not?
3. Instead of a datasource lookup if I do a DriverManager.getConnection(), how does that affect the transactions?
Thanks, Arun N [ September 14, 2006: Message edited by: Arun Natrajan ]