users@glassfish.java.net

JPA, connection pools, how?

From: <glassfish_at_javadesktop.org>
Date: Tue, 06 May 2008 01:25:43 PDT

Hi,

I have a question regarding JPA and Persistence - how do I access a server-side connection pool from a Jave SE class?

1) My server (Glassfish V2) has a connection pool for MySQL, and a jdbc resource to that pool
2) I have an external controller class (SE) which is linked to a web project (JSF), which contains the Persistance unit and controller logic

I want to be able to use my server connection pool but can't figure out how to tell the Entity factory which server to use (if this can actually be done? It doesn't really make sense).

I have tried adding the controller logic and Entity classes to the Web project instead of a separate J2SE project, but even though everything builds and deploys, I get runtime errors about the app not finding the Entity classes.

This seems to be kind of a catch-22. I really don't want the J2SE app to be hardcoded to a database server, ideally this connection should be managed on the Application server.

Any help dearly appreciated!
Kind regards,
Andi
[Message sent by forum member 'andir' (andir)]

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