persistence@glassfish.java.net

Use same persistence unit in ejb and web tier

From: Benjamin Graf <Benjamin.Graf_at_gmx.net>
Date: Mon, 23 Oct 2006 09:36:02 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

I'm looking for a possibility to share a persistence unit in the web and the ejb
 part of a enterprise application but failed. I tried two ways:

1. Implement persistence unit in both parts with the same name, but I seems to
address to individual persistence contexts in glassfish since data isn't
synchronized.

2. Implement persistence unit only in the ejb tier throws NPE in web tier while
using EntityManager.

3. The last but not yet tested solution may be to take all entity stuff into the
ejb tier and make the web application use them to get the data from the database.

Are there any better solutions?

THX Benjamin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFFPHDi+oSgMM7Y9KsRAwQlAJ9C42Rz0qtpMW8RdCH55SySiQ6PmgCdFdji
5aTsz7SDY2YWwIwK/pFFI4I=
=mwZZ
-----END PGP SIGNATURE-----