As you can see, the initialisation of the mtcHistoryLocal is dependent on the retrieval of the mtcEntityLocal entity bean. Therefore, if the entity does not exist we catch the FinderException and do something else.
And most of the time this works fine. In fact, I cannot replicate the problem, so I only have some server logs to go by. These state that a NoSuchEntityException is thrown when a 'get' method is called on mtcEntityLocal within mtcHistoryLocalHome.create(primaryKey, mtcEntityLocal)
I cannot understand why this might be, since there is no way through the application to remove the underlying data record; thus eliminating a concurrency problem.
All beans have <trans-attribute>Required</trans-attribute> in ejb-jar.xml so I'm thinking there should be no transactional problem.
Since the problem is intermittent, I have trouble investigating the state of the data when it occurs; when the problem does occur, a 2nd attempt is successful.
The application server is weblogic 8.1 and the database is Informix (not sure of the version).
This is all part of the same transaction, so surely this is no problem. But I am wondering whether there is a chance that the MTCEntity-MEntity relationship is causing confusion such that the mtcEntityLocalHome.findByPrimaryKey(primaryKey) succeeds despite no entity existing.
As you can see I am quite confused, any help gratefully received. Thanks, Jim