I have a stateful session bean that wraps a CMP entity bean for persistence
services.  In the session beans 'save()' method it creates the CMP entity
bean and then creates some dependent data using a "helper class".  The
"helper class" provides data access to a table containing dependent data
for the CMP bean.  There is a foreign key constraint between the table
holding the dependent data and the OID of the CMP bean.  The helper class
is not an entity bean but simply gets a connection and inserts data into
the table using JDBC.  The problem I am having is that when I attempt to
insert the dependent data into the table I get a constraint violation -- at
first this seemed impossible since I create the CMP bean first ... however,
I realized that the problem is that the creation of the dependent data is
using the same connection as the CMP bean.  If I remove the constraint
everything works fine ...
Is there a way of getting the connection being used by the CMP bean?  Is
there a better approach to this problem other than (1) converting the CMP
bean to BMP, or (2) removing the database constraint, or (3) making the
dependent data a full-blown entity bean?

Bill Siggelkow
Senior Software Engineer
Syndesa, Inc.
http://www.syndesa.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to