I have a question regarding transaction propagation. I took the orion
primer example and modified it so that the servlet calls Hello and then
the Hello Bean calls A HashCoder bean. Both Hello and HashCoder beans
are stateless session beans and perform SQL. The Hello does a delete
and the HashCoder an incorrect select (causing a SQLException). I was
expection these two operations to happen in the same transaction, so
that the SQLException would cause the delete to automatically rollback
since for both these beans I specified Container managed transaction.
But it did actually delete the row. So it seems they two methods were
running in different transactions.
The only thing I did not do is to specify the tranaction attribute to
the bean's methods to be Required or anything else. I don't know what
it defaults to in orion.
I am using DB2 v. 6.1 as the Database, the in both beans I acquire the
connection through JNDI DataSource. I configured the data-sources.xml
for DB2 as follows:
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="Db2"
location="jdbc/Db2CoreDS"
xa-location="jdbc/xa/Db2XADS"
ejb-location="jdbc/Db2DS"
connection-driver="COM.ibm.db2.jdbc.app.DB2Driver"
username="db2admin"
password="db2admin"
url="JDBC:DB2:EB2"
inactivity-timeout="30"
/>
I am attaching the zip file containing the modified orion primer
example, that can be built simply by tying ant.
I would like to know how to get something like this where multiple
session beans participate in a single transaction such that if any one
throws an SQLException the transaction is rolled back by the container.
Thanks in advance.
Aziz Sharif
__________________________________________________
Do You Yahoo!?
>From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/
orion-primer.zip