These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: transfer hibernate project from 3.2.5 to 3.2.7
PostPosted: Tue Mar 15, 2005 7:50 am 
Newbie

Joined: Thu Mar 10, 2005 7:29 am
Posts: 3
hi all,

i have a problem transfering my webapp from jboss 3.2.5 to 3.2.7.
on 3.2.5 it goes pretty good. but on 3.2.7 i have a big problem.
The only thing i changed is my jboss-service.xml which i deleted and replaced by a hibernate-service.xml.

my files where all packed in a har archive.

I´am deployed my files without any errors. but testing with a client gives an error that i have to set AUTOCOMMIT = ON.
but where can i do this. in hibernate-service.xml, or shall i use an hibernate.cfg.xml

here my config
hibernate-service.xml
Code:
<server>
   <mbean code="org.jboss.hibernate.jmx.Hibernate"
       name="jboss.har:service=Hibernate">
        <attribute name="DatasourceName">java:/PostLfaDS</attribute>
        <attribute name="SessionFactoryName">java:/hibernate/HibernateFactory</attribute>
         <attribute name="Dialect">net.sf.hibernate.dialect.PostgreSQLDialect</attribute>
        <attribute name="CacheProviderClass">net.sf.hibernate.cache.TreeCacheProvider</attribute>
          <attribute name="ShowSqlEnabled">true</attribute>
      </mbean>
</server>


Hibernate version:
2.1.8.

Full stack trace of any exception that occurs:
Code:
2005-03-15 11:57:05,446 DEBUG [net.sf.hibernate.impl.SessionImpl] find: from LfaLogfile log order by log.lfFileposition desc
2005-03-15 11:57:05,450 DEBUG [net.sf.hibernate.engine.QueryParameters] named parameters: {}
2005-03-15 11:57:05,473 DEBUG [net.sf.hibernate.hql.QueryTranslator] compiling query
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] flushing session
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushing entities and processing referenced collections
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Processing unreferenced collections
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Scheduling collection removes/(re)creates/updates
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collec
tions
2005-03-15 11:57:05,507 DEBUG [net.sf.hibernate.impl.SessionImpl] Dont need to execute flush
2005-03-15 11:57:05,508 DEBUG [net.sf.hibernate.hql.QueryTranslator] HQL: from biz.objectone.lfa.hibernate.pojo.LfaLogfile lo
g order by log.lfFileposition desc
2005-03-15 11:57:05,508 DEBUG [net.sf.hibernate.hql.QueryTranslator] SQL: select lfalogfile0_.lf_id_pk as lf_id_pk, lfalogfil
e0_.lf_uri as lf_uri, lfalogfile0_.lf_fileposition as lf_filep3_, lfalogfile0_.lf_parsetime as lf_parse4_ from lfa.lfa_logfil
es lfalogfile0_ order by  lfalogfile0_.lf_fileposition desc
2005-03-15 11:57:05,510 DEBUG [net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
2005-03-15 11:57:05,513 WARN  [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=
h4369.serverkompetenz.net//14, BranchQual=] errorCode=XA_UNKNOWN(0)
org.jboss.resource.connectionmanager.JBossLocalXAException: Error trying to start local tx: ; - nested throwable: (org.jboss.
resource.JBossResourceException: SQLException; - nested throwable: (java.sql.SQLException: FEHLER:  SET AUTOCOMMIT TO OFF wir
d nicht mehr unterstützt
))
        at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.start(TxConnectionManager.java:654)
        at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1196)
        at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:649)
        at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java
:437)
        at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:323
)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:503)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnecti
onManager2.java:888)
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
        at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
        at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:292)
:




Name and version of the database you are using:
Postgresql 3.2.7


I am not sure where i have to change autocommit.

Thank you in advance for looking at my question.

boris


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 3:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The datasource definition file, I would guess


Top
 Profile  
 
 Post subject: found the conclusion
PostPosted: Fri Mar 18, 2005 2:47 pm 
Newbie

Joined: Thu Mar 10, 2005 7:29 am
Posts: 3
finally i found the conclusion .... just two lines of code.

Code:

    public HibernateSession getHibernateSession(){

       ....... get session  ....

        Connection conn = hibernateSession.connection();
        conn.setAutocommit(true);

    }



thats it and it works.

boris

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 3:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No that's not the right solution. Great if it works for you and you want to maintain a forked version of those classes (i.e., that will *not* be a standard feature).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.