Hi Whalley
I don't know hibernate at all, but I have put you here

http://www.architectedulogiciel.fr/download/testjoin.zip

a small sample of code that should works with EclipseLink and Resin 4,0,14

The entity manager is created directly with injection from resin.conf 
and the persistence.xml includes a line to specify the 
eclipselink.ddl-generation.output-mode

PS: the database associated with the sample is described in the file 
database.sql (mysql script)

On 03/02/11 01:25, c.whalley wrote:
> I've a project which followed the hibernate example here:
> http://wiki.caucho.com/Hibernate
> I'm now trying to do the same but with eclipselink as supplied with
> Resin 4.0.14 pro. I extended that hibernate example to perform commits
> using UserTransaction and EntityManager instances but when I used the
> same code with eclipselink I get
>
> "[EL Severe]: 2011-02-02
> 23:23:52.406--ServerSession(4188490)--java.lang.IllegalStateException:
> Can't allocate connection because the connection pool is closed."
>
> I'm sure this is a newbie db config problem. The servlet code is
>
> @PersistenceUnit(unitName="contact")
> EntityManagerFactory emf;
>
> @Inject
> private UserTransaction ut;
>
> private EntityManager em;
>
> public void service(HttpServletRequest req, HttpServletResponse res)
>       throws IOException, ServletException {
>
>       PrintWriter out = res.getWriter();
>       res.setContentType("text/html");
>
>       Contact contact;
>       try {
>           ut.begin();
>           em = emf.createEntityManager();
>
>           ...
>
> and the exception occurs at that last line. I defined my db in
> resin-web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://caucho.com/ns/resin";>
> <system-property service.version.id='LnJPA 1.00'/>
>
> <database>
> <jndi-name>jdbc/contact</jndi-name>
> <driver type="org.gjt.mm.mysql.Driver">
> <url>jdbc:mysql://localhost:3306/Contact</url>
> <user>root</user>
> <password/>
> </driver>
> </database>
> </web-app>
>
> And thought the<jta-data-source>  entry in persistence.xml was all I
> needed to wire it up:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="1.0">
> <persistence-unit name="contact">
> <provider>org.eclipse.persistence..PersistenceProvider</provider>
>
> <jta-data-source>jdbc/contact</jta-data-source>
>
> <class>com.otamate.jee.contact.Contact</class>
>
> <exclude-unlisted-classes/>
>
> </persistence-unit>
> </persistence>
>
> Is there something else I should be doing please?
>
> -- Carl Whalley http://www.androidacademy.com
>
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>

-- 
Riccardo Cohen
Architecte du Logiciel
http://www.architectedulogiciel.fr
BP 77536
37075 Tours Cedex 2
+33 (0)6.09.83.64.49
Membre du réseau http://www.reflexe-conseil-centre.org


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to