users@glassfish.java.net

Deisgn pattern question, seed Data initialization ?

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 Dec 2009 20:28:46 PST

Hello all,

I'm designing a new project which employs java persistence and several stateless beans. My project requires some initial data in the database.

My question is, what is the usual practice on seed data initialization ? are they inserted manually through executing SQL commands and export dump ?

My idea initially was to write a JUnit in which I would create an embeddable ejb container and obtain my JpaController beans and use the EntityManager to persist initial data though java code. However, after I've tried that, it turned out that when the embeddable container is destroyed , the generated entities and persisted data are gone from the database.
[Message sent by forum member 'anajjar' (a.najjar_at_me.com)]

http://forums.java.net/jive/thread.jspa?messageID=377075