users@glassfish.java.net

Re: glassfish & datapools

From: <glassfish_at_javadesktop.org>
Date: Mon, 26 May 2008 05:34:54 PDT

Thanks

Okay, you understand right. once more time, sorry for my bad english. Effectively, I have created the datasource in the admin console first. And actually, I have removed it on the admin console and edited a new one with the sun-ressources.xml. I really don't think the problem comes from my definitions because in the two cases, I have the same result. For info, this is sun-ressources.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
  <jdbc-resource enabled="true" jndi-name="jdbc/ejb3project" object-type="user" pool-name="ejb3project">
    <description/>
  </jdbc-resource>
  <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.hsqldb.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="ejb3project" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
    <property name="Database" value="jdbc:hsqldb:hsql://localhost/contact"/>
    <property name="Username" value="sa"/>
    <property name="Password" value="psswd"/>
  </jdbc-connection-pool>
</resources>

And my persistence unit:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="contactUnit" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/ejb3project</jta-data-source>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
    </properties>
  </persistence-unit>
</persistence>

I think there is no problem with this datasource, I can see it in the ressources. The strange thing is that glassfish (I suppose by the intermediary of netbeans) tries to create an other datasource named jdbc_hsqldb_hsql_localhost_contactPool with the org.hsqldb.jdbcDriver. I absolutely don't know why it does this. Not only it creates this other datasource, but also with bad parameters... I wonder if I have created something with a netbean template that could be the cause of this problem. But in the sources/files/services, I don't see anything...

I am clear?
[Message sent by forum member 'rageice' (rageice)]

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