[jboss-user] [EJB 3.0] - Re: My EJB don't access the database

LeandroSeverino do-not-reply at jboss.com
Tue Nov 6 13:10:43 EST 2007


My persistence.xml:


  | <?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="PU" transaction-type="JTA">
  |     <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |     <jta-data-source>java:/maragato</jta-data-source>
  |     <properties>
  |       <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
  |     </properties>
  |   </persistence-unit>
  | </persistence>
  | 

and my jboss-ds.xml:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>maragato</jndi-name>
  |     <connection-url>jdbc:postgresql://10.10.10.23:5432/maragato</connection-url>
  |     <driver-class>org.postgresql.Driver</driver-class>
  |     <user-name>postgres</user-name>
  |     <password>postgres</password>
  |     <min-pool-size>5</min-pool-size>
  |     <max-pool-size>20</max-pool-size>
  |     <idle-timeout-minutes>5</idle-timeout-minutes>
  |     <exception-sorter-class-name />
  | 
  |     <!-- sql to call when connection is created.  Can be anything, select 1 is valid for PostgreSQL -->
  | 
  |     <new-connection-sql>select 1</new-connection-sql>
  | 
  |     <!-- sql to call on an existing pooled connection when it is obtained from pool.  Can be anything, select 1 is valid for PostgreSQL -->
  | 
  |     <check-valid-connection-sql>select 1</check-valid-connection-sql>
  |   </local-tx-datasource>  
  | </datasources>
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102299#4102299

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102299



More information about the jboss-user mailing list