Hi.
I've recently upgraded from jboss 4.0.3 to 4.0.4GA, and I've had some troubles
getting hibernate to work correctly. I'm almost there now, except whenever I
try to make changes to the database, nothing happens!?
So there must be something I'm missing..
Either my config is wrong, or my strategy is wrong.
this is my jboss-service.xml:
| <server>
| <mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.TRIM:name=HibernateSessionFactory">
| <!-- Wait for the Postgres Datasource to be defined -->
| <!-- <depends>jboss.jca:service=RARDeployer</depends> -->
| <!-- <depends>jboss.jca:service=LocalTxCM,name=PostgresDS</depends>
-->
|
<depends>jboss.jca:service=DataSourceBinding,name=PostgresDS</depends>
|
| <attribute name="DatasourceName">java:/PostgresDS</attribute>
| <attribute
name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
| <attribute name="Username">admin</attribute>
| <attribute name="Password">123456</attribute>
| <attribute
name="SessionFactoryName">java:/hibernate/TRIMSessionFactory</attribute>
|
|
| <!-- We do want hibernate to look everywhere for mapping files-->
| <attribute name="ScanForMappingsEnabled">true</attribute>
|
| <!-- We also want to see the actual SQL -->
| <attribute name="ShowSqlEnabled">true</attribute>
| <attribute name="SqlCommentsEnabled">true</attribute>
|
| <!-- Second level caching -->
| <attribute name="SecondLevelCacheEnabled">true</attribute>
| <attribute
name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
| <attribute name="QueryCacheEnabled">false</attribute>
|
| </mbean>
| </server>
|
and this is how I use hibernate.
| public boolean saveEditedRelationType ( RelationType relationType) {
| try {
| // Get session from session factory
| Session session =
HibernateSessionFactory.currentSession();
|
| // Tell hibernate to save to database, gets the object
ID in return
| session.saveOrUpdate( relationType );
|
| return true;
|
| } catch (HibernateException hex) {
|
when I use the ShowSqlEnabled in my config, I only see selects in the output..
shouldn't there be updates or inserts?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950601#3950601
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950601
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user