This content has been marked as final.
Show 2 replies
-
1. Re: newbie -- seam, websphere 7 and mysql confusion
titou09 Aug 7, 2009 12:45 AM (in response to webutr)It seems you have already created a connection pool pointing to your database and tested in with the WAS console. The driver used for your connection pool must support XA transactions (not 100% sure of that and don't knoe the name of this driver..)
So now, edit the
META-INF/persistence.xml
file and :- add the line
<property name\="dialect">org.hibernate.dialect.MySQLDialect</property>
- change the value of the <jta-data-source> tag to the JNDI name you set for your connection pool with the WebSphere console when you created it (e.g.
jdbc/MySqlDatabase
)
Rebuild then redeploy
- add the line
-
2. Re: newbie -- seam, websphere 7 and mysql confusion
webutr Aug 11, 2009 3:38 PM (in response to webutr)Here following is the persistence file for the seam booking example.
The change I introduced was similar to what you suggested.
Thank you very much for putting me in the ball park.
Your help was very much appreciated.
<?xml version="1.0" encoding="UTF-8"?>
<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="bookingDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- use this data source name for Glassfish -->
<!-- <jta-data-source></jta-data-source> -->
<jta-data-source>jdbc/bookingDatabase</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<!-- <property name="hibernate.transaction.flush_before_completion" value="true"/> -->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<!-- <property name="hibernate.dialect" value="GlassfishDerbyDialect"/> -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
</properties>
</persistence-unit>
</persistence>
<blockquote>
_Denis Forveille wrote on Aug 07, 2009 00:45:_<br/>
It seems you have already created a connection pool pointing to your database and tested in with the WAS console. The driver used for your connection pool must support XA transactions (not 100% sure of that and don't knoe the name of this driver..)
So now, edit the "META-INF/persistence.xml" file and :
= add the line "|<property name\="dialect">org.hibernate.dialect.MySQLDialect</property>|"
= change the value of the |<jta-data-source>| tag to the JNDI name you set for your connection pool with the WebSphere console when you created it (e.g. "jdbc/MySqlDatabase")
Rebuild then redeploy
</blockquote>
Click HELP for text formatting instructions. Then edit this text and check the preview.