tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jeano...@gmail.com>
Subject Re: No results from query on postgres
Date Sat, 28 Sep 2013 17:12:36 GMT
OK then, You need instead of configuring your datasource in the hibernate
xml file, you need to add a jta data source in the persistence.xml file and
create a data source in conf/tomee.xml with the same name. Checkout the
large number of examples. That should work easily.
Le 28 sept. 2013 19:09, "emaborsa" <info@emaborsa.com> a écrit :

> My persistence.xml:
>
> <persistence-unit name="docTracingPU" transaction-type="JTA">
>         <provider>org.hibernate.ejb.HibernatePersistence</provider>
>
> <non-jta-data-source>java:comp/env/jdbc/docTracing</non-jta-data-source>
>
>
> <class>com.emaborsa.doctracing.core.persistentobject.UtentePO</class>
>
> <class>com.emaborsa.doctracing.core.persistentobject.CartellaPO</class>
>
>
> <class>com.emaborsa.doctracing.core.persistentobject.AutorizzazionePO</class>
>
>
> <class>com.emaborsa.doctracing.core.persistentobject.StoricoUtilizzoCartellaPO</class>
>         <properties>
>                 <property name="hibernate.dialect"
> value="org.hibernate.dialect.PostgreSQLDialect"/>
>                 <property name="hibernate.hbm2ddl.auto" value="update" />
>                 <property name="hibernate.transaction.manager_lookup_class"
> value="org.apache.openejb.hibernate.TransactionManagerLookup" />
>
>                 <property name="format_sql" value="true" />
>                 <property name="hibernate.show_sql" value="true" />
>                 <property name="use_sql_comments" value="true"/>
>         </properties>
> </persistence-unit>
>
> My hibernate.cfg.xml:
>
> <session-factory>
>         <property
> name="connection.url">jdbc:postgresql://127.0.0.1:5432/mydb</property>
>         <property
> name="connection.driver_class">org.postgresql.Driver</property>
>         <property name="connection.username">myuser</property>
>         <property name="connection.password">mypass</property>
>         <property
>
> name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
>         <property
> name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
>         <property
>
> name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
> </session-factory>
>
> I have not configured anything else...
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/No-results-from-query-on-postgres-tp4665339p4665342.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message