You are correct. I would check to see if you are actually in the same transaction (get the transaction from the transaction manager and print the hashcode). My guess is you have not exited the outer most transaction.
Other wise file a bug report at sourceforge.
We are seeing the same behavior when we invoke a BMP entity bean from a client application (in our test suite). The ejbLoad method seems to be invoked inconsistently. The following assertion results in intermittent failures
Book book = bookHome.create();
assertNull(book.getName()); // If we get an ejbLoad this
//value would be null
We have no user transaction active so each call on the entity is invoked in a separate transaction.
This looks like a defect to me... Has it been logged?
We have the same problem. Our commit-option-C entity bean is not ejbLoad()ed when invoking a method outside a transaction context.
This is because jboss removes the entity bean from the cache only after the transaction has completed (as stated by the spec). The case when running without a transaction remains unspecified and unhandled. Thus, the container still treats the bean as valid for the next method invocation.
The same problem should apply to commit-option-B entity beans, but we haven't checked this.
Hey JBoss developer(s): We have implemented a fix for this problem and it seems to work in our case, but I don't have the time and deeper knowledge of JBoss in order to handle this correctly. Please contact me so we can discuss the details.
We are also experiencing intermittent behavior. We use commit option C, and the ejbLoad() method is sometimes not called when the entity is first enlisted into a new transaction.
Using the current head (jBoss 3.1 alpha).
If you want this fixed you need to post a bug report with a testcase, otherwise this issue will disappear into the ether.
Dain, these intermittent problems are the toughest to isolate into a neat test case. Perhaps, it would be easier to isolate a bug in the code by analyzing it. Can you relate the classes that one may look at that control when and under what circumstances ejbLoad() is invoked?
I think this is an interaction between the cache and the EntityInstanceInterceptor, but this is outside of my area of expertise.
I would bet you could just create a couple of clients that set instance variables in a commit option C bean to see interaction.
If you can't create a testcase, just create a detailed bug report.