Skip to main content

Inserting to DB after ejbCreate

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
riksweeney
Offline
Joined: 2007-07-30

As I understand it, Glassfish performs all of its Entity Bean insertions at the end of the transaction. I'm migrating a Weblogic application which expects some data to exist in the database once the ejbCreate method ends to prevent foreign key constraint issues.

I've had a look at the "flush-at-end-of-method" setting for my Entity Bean, but this does not appear to work, perhaps I'm configuring it incorrectly.

Does anyone know how I can get my Entity Bean to insert into the DB after the ejbCreate (or even ejbPostCreate) method completes?

I'm using GlassFish 3.1.2

Richard

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
riksweeney
Offline
Joined: 2007-07-30

OK, I see what the problem was. The flush-at-end-of-method setting does work as expected, but when I configured it to fire after the ejbCreate method, it actually fires after the ejbPostCreate method.