Hi, Here is yet another ejbStore() call problem : I have a CMP entity bean mapping a table. In my program it is created from a "wrapper" Session Bean that encapsulates data access. The session bean method has a TRANSACTION_READ_COMMITTED isolation setting. Then the method goes on to create a related record in another table that has a foreign key constraint to the "Entity" table, using other classes (the Data Access Object Pattern). The method fails throwing an SQLException saying the foreign key constraint is violated : in fact the Entity ejbStore() method is never called. Actually, all my EJB methods (for session and entity beans) have a TRANSACTION_READ_COMMITTED isolation setting because I previously ran into an Oracle Serialization problem (the well-known ORA-08177 widely discussed in other forums). Generally, we use DAO classes to perform all "dependent" tables management, the main table being mapped to an entity bean. What transaction setting or strategy should I use to make this work ? I'm using Weblo 5.1 SP 11 on NT Thanks in advance.
I can see two potential areas causing this problem. As the container is free to cache database updates for performance, by using a method other than through the container to access a newly created instance maybe the underlying DB has not yet been updated. This could be from either the ejbStore() or ejbCreate() methods. Also as 'The entity bean provider should use the ejbStore() method to update the instance using the accessor methods before its persistant state is synchronised.' (EJB specification) perhaps your server has taken this part of the contract to mean that you should be calling the ejbStore() method to synchronise rather than relying on its having done so.
The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop