[jboss-user] [EJB 3.0] - Re: Can a Stateless bean make a call to an entity bean to pe

oskar.carlstedt do-not-reply at jboss.com
Wed Jun 27 05:00:57 EDT 2007


Sorry, now thing got messed up here. We take the examples once again. Look at the JNDI-names. These got messed in the previous post.

//Oskar

persistence.xml

  | <persistence 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"
  |     version="1.0">
  |     <persistence-unit name="my-ejbs">
  |         <jta-data-source>
  | 		    <!--
  | 			    THIS NAME SHALL MAP AGAINST THE JNDI-NAME OF
  | 				YOUR DATA SOURCE FILE
  | 			-->
  |             java:/my-service-DS
  |         </jta-data-source>
  |         <properties>
  |             <property name="show_sql" value="true" />
  |             <property name="dialect"
  |                 value="org.hibernate.dialect.MySQLDialect" />
  |         </properties>
  |     </persistence-unit>
  | </persistence>
  | 

my-service-ds.xml

  | <?xml version="1.0" encoding="UTF-8"?>
  | <datasources>
  |     <local-tx-datasource>
  |         
  |         <!--
  |             JNDI NAME OF DATA SOURCE - 
  | 			THIS NAME IS MAPPED IN PERSISTENCE.XML IN YOUR EAR FILE
  |         -->
  |         <jndi-name>my-service-DS</jndi-name>
  |         
  |         <!--
  |             Connect parameters
  |         -->
  |         <connection-url>
  |             jdbc:${jdbc.vendor}://${db.host}:${db.port}/${db.name}
  |         </connection-url>
  |         <user-name>${db.username}</user-name>
  |         <password>${db.password}</password>
  |         <driver-class>${jdbc.driverclass}</driver-class>
  |         
  |         <!--
  |             Minimum and maximum poolsize
  |         -->
  |         <min-pool-size>0</min-pool-size>
  |         <max-pool-size>5</max-pool-size>
  |         
  |         <!--
  |             No of minutes in idle state until connection is destroyed 
  |         -->
  |         <idle-timeout-minutes>1</idle-timeout-minutes>
  |         
  |         <!--
  |             Class used to detect if connection is valid or not. Using MySQL, this
  |             class shall only be used on drivers after 3.22.1 with "ping" support
  |         -->
  |         <valid-connection-checker-class-name>
  |             org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker
  |         </valid-connection-checker-class-name>
  |         
  |         <!--
  |             Class used when sorting exceptions
  |         -->
  |         <exception-sorter-class-name>
  |             org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
  |         </exception-sorter-class-name>
  |         
  | 
  |         <!--
  |             corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
  |         -->
  |         <metadata>
  |             <type-mapping>mySQL</type-mapping>
  |         </metadata>
  |     </local-tx-datasource>
  | </datasources>
  | 
  | 


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

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



More information about the jboss-user mailing list