-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with Hibernate Identity and Sybase ASA
PostPosted: Tue Mar 02, 2004 4:16 am 
Newbie

Joined: Tue Mar 02, 2004 3:54 am
Posts: 2
Hi all,

after searching this forum and try to figure it out myself last nigth, I hope someone has a clue whats wrong in my app :-)

I have Hibernate 2.1.2 on JBoss 3.2.3 connected to a Sybase Adaptive Anywhere 7 Database. I use the JTASession classes from one of the forum posts to handle the Hibernate Session with the transaction.
I try to create a new record in the database with the identity key generater.

Class mapping and log entries below.
I already checked the mapping for typos and disabled all my triggers on that table.

TIA,
Martin

PS: I have the same configuration on another server with a firebird database and can insert records without any problems.

My class mapping:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="ch.xx.hibernate.transfer.Transfer" table="ip2_transfer" dynamic-update="false" dynamic-insert="false">
<id name="transId" column="trans_id" type="java.lang.Long">
<generator class="identity">
</generator>
</id>
<property name="bemerkung" type="java.lang.String" update="true" insert="true" column="trans_bemerkung"/>
<property name="betrId" type="java.lang.Long" update="true" insert="true" column="btr_rsn"/>
<property name="data" type="binary" update="true" insert="true" column="trans_data"/>
<property name="data2" type="binary" update="true" insert="true" column="trans_data2"/>
<property name="erfasst" type="java.util.Date" update="true" insert="true" column="trans_erfasst"/>
<property name="interfacetyp" type="java.lang.String" update="true" insert="true" column="trans_interfacetyp"/>
<property name="language" type="java.lang.String" update="true" insert="true" column="trans_language"/>
<property name="status" type="java.lang.Short" update="true" insert="true" column="trans_status"/>
<property name="transTransId" type="java.lang.Long" update="true" insert="true" column="trans_trans_id"/>
<property name="uebermittelt" type="java.util.Date" update="true" insert="true" column="trans_uebermittelt"/>
<property name="verarbeitet" type="java.util.Date" update="true" insert="true" column="trans_verarbeitet"/>
</class>
</hibernate-mapping>


The log entries with the error message at the end:
09:07:39,099 DEBUG [EntityPersister] Inserting entity: ch.hrms.import2.hibernate.transfer.Transfer (native id)
09:07:39,099 DEBUG [BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
09:07:39,099 DEBUG [SQL] insert into ip2_transfer (trans_bemerkung, btr_rsn, trans_data, trans_data2, trans_erfasst, trans_interfacetyp, trans_language, trans_s
tatus, trans_trans_id, trans_uebermittelt, trans_verarbeitet) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
select @@identity
09:07:39,099 DEBUG [BatcherImpl] preparing statement
09:07:39,099 DEBUG [EntityPersister] Dehydrating entity: [ch.hrms.import2.hibernate.transfer.Transfer#<null>]
09:07:39,099 DEBUG [StringType] binding 'Source-IP: xx' to parameter: 1
09:07:39,099 DEBUG [LongType] binding '1100' to parameter: 2
09:07:39,099 DEBUG [BinaryType] binding '80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
0808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
080808080808080808080808080808080' to parameter: 3
09:07:39,099 DEBUG [BinaryType] binding '808080808080808080' to parameter: 4
09:07:39,109 DEBUG [TimestampType] binding '10 Februar 2004 16:31:11' to parameter: 5
09:07:39,109 DEBUG [StringType] binding 'h2interface/transmitlog' to parameter: 6
09:07:39,109 DEBUG [StringType] binding 'D' to parameter: 7
09:07:39,109 DEBUG [ShortType] binding '1' to parameter: 8
09:07:39,109 DEBUG [LongType] binding '34' to parameter: 9
09:07:39,109 DEBUG [TimestampType] binding null to parameter: 10
09:07:39,109 DEBUG [TimestampType] binding null to parameter: 11
09:07:39,109 DEBUG [BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
09:07:39,109 DEBUG [BatcherImpl] closing statement
09:07:39,109 DEBUG [JDBCExceptionReporter] SQL Exception
com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -143: Column '@p0' not found
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2439)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1865)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:201)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:182)
at com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1455)
at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:1440)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:70)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:304)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:508)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:906)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:839)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:757)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:720)
at ch.hrms.import2.ejb.message.TransferMessageBean.moveTransferRecords(TransferMessageBean.java:169)
at ch.hrms.import2.ejb.message.TransferMessageBean.processMessage(TransferMessageBean.java:29)
at ch.hrms.import2.ejb.message.InterfaceWorkerMessageBean.onMessage(InterfaceWorkerMessageBean.java:102)
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.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
at org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT.invoke(MessageDrivenTxInterceptorBMT.java:32)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
at org.jboss.ejb.Container.invoke(Container.java:700)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
at org.jboss.mq.SpySession.run(SpySession.java:298)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject: Problem with Hibernate Identity and Sybase ASA
PostPosted: Tue Mar 02, 2004 7:00 am 
Newbie

Joined: Tue Mar 02, 2004 3:54 am
Posts: 2
In the meantime I found out, that it does not work with key-generator "native" and "identity" (what most likely will be the same in the end). It does work with key-generator "increment".

Will check, if the version of the jconnect library has something to do with it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.