-->
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.  [ 1 post ] 
Author Message
 Post subject: Ingres error when saving objects
PostPosted: Tue Jun 29, 2004 8:25 pm 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:52 pm
Posts: 27
Location: Santa Cruz do Sul - RS - Brazil
(JBoss 3.2.3 + Hiberante 2.11 + JDK 1.4.02 + Ingres 2.x)
Hi all,
I trying to migrate my DS from Postgres to Ingres, but I have problems when saving a graph of the objects (Note: the same code works very well in Postgres).
I think that it is a problem in autocommit property in Connection, but do not know as to configure it...
I can see the discussion in http://forum.hibernate.org/viewtopic.php?t=927295, but it did not help me.
I pay a beer for any suggestion :-)

The DS file is:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>guUniscDS</jndi-name>
    <connection-url>jdbc:edbc://idesenv:ID7/guunisc</connection-url>
    <driver-class>ca.edbc.jdbc.EdbcDriver</driver-class>
    <user-name>guunisc</user-name>
    <password>guunisc</password>
  </local-tx-datasource>
</datasources>


The MBean is:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Contributed by Marcelo Mrack, 27/Jan/2004, 19/May/2004, 21/Jun/2004 -->
<server>
   <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactoryGuUnisc">
      <depends>jboss.jca:service=RARDeployer</depends>
      <depends>jboss.jca:service=LocalTxCM,name=guUniscDS</depends>
      <attribute name="MapResources">
         br/unisc/gu/beans/Integrante.hbm.xml,
         br/unisc/gu/beans/Perfil.hbm.xml,
         br/unisc/gu/beans/Pessoa.hbm.xml,
         br/unisc/gu/beans/Objeto.hbm.xml,
         br/unisc/gu/beans/Permissao.hbm.xml,
         br/unisc/gu/beans/Acao.hbm.xml
      </attribute>
      <attribute name="JndiName">java:/br/unisc/gu/GerenciadorDeUsuarios</attribute>
      <attribute name="Datasource">java:/guUniscDS</attribute>
      <attribute name="Dialect">net.sf.hibernate.dialect.IngresDialect</attribute>
      <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
      <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
      <attribute name="UseOuterJoin">false</attribute>
      <attribute name="ShowSql">true</attribute>
      <attribute name="UserTransactionName">UserTransaction</attribute>
   </mbean>
</server>

The log in JBoss is:
Code:
17:44:10,277 INFO  [unisc] SessionFactoryImplementor is: net.sf.hibernate.impl.SessionFactoryImpl
17:44:10,605 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
17:44:10,605 ERROR [JDBCExceptionReporter] You cannot commit during a managed transaction!
17:44:10,605 ERROR [JDBCExceptionReporter] Could not save object
java.sql.SQLException: You cannot commit during a managed transaction!
        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:495)
        at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:467)
        at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:126)
        at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59)
        at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:727)
        at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:717)
        at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1322)
        at br.unisc.commom.ejb.util.AbstractHibernate.saveOrUpdate(AbstractHibernate.java:59)
        at br.unisc.commom.ejb.GuHibernateBean.saveOrUpdate(GuHibernateBean.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
        at org.jboss.ejb.Container.invoke(Container.java:700)
        at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
        at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
        at $Proxy36.saveOrUpdate(Unknown Source)
        at br.unisc.gu.ejb.GerenciadorDeUsuariosBean.saveOrUpdate(GerenciadorDeUsuariosBean.java:613)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
        at org.jboss.ejb.Container.invoke(Container.java:700)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

_________________
Do you still create DTO factories? Oh, no!
Try DTOptimzier now!
https://dtoptimizer.dev.java.net/


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

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.