persistence@glassfish.java.net

Shared entities - Container-managed persitence

From: Allan Juul <gf_at_muly.dk>
Date: Sat, 13 Jun 2009 09:05:41 +0200

hi

[first post here]

is the following scenario possible ?

In my GF webContainer i have two web applications:

   /webappWriter

   /webappReader


these two web apps should access data from the same datasource (mysql
db) and therefore (hopefully) share the same entity classes.

so these entity classes will be in some "shared" og "common" namespaced
library.


if I create separate identical Entityclasses it seems to work ok, but if
i factor these out to my common library i get a

****
java.lang.IllegalArgumentException: Object:
my.name.space.common.Item[id=1244876498959]
is not a known entity type
****


i imagine i have a persitence.xml issue - because the "common" library
need its own persitence.xml (at least in netbeans) and so does the
respective webapps. so which one wins?


anyway, any pointers much appreciated

./allan