I have the following in the same method inside a session bean

1 - Get a datasource using the EJB Datasource lookup
2 - Get a connection using this datasource
3 - Write a JDBC query to delete some rows
4 - Call the remove method in an Entity bean

What is happening is that the JDBC call is not using the same transaction as
the Entity bean and this is causing a deadlock. The Entity bean call is
waiting on the JDBC statements to be commited. But these statements will not
be commited until the entity bean finishes the delete.

I thought that since both  session bean and entity bean are declared as
REQUIRE for transaction in the ejb-jar.xml that they would automatically be
inside the same transaction.

Is this a bug or is there something that I am missing?

Eduardo

Reply via email to