Hibernate version:
2.1.6
Mapping documents:
<hibernate-mapping package="xxx.domain">
<class name="BostotteSisteSakDO" table="SISTE_SAKER" polymorphism="explicit">
<id name="idSisteSaker" column="ID_SISTE_SAKER" type="integer">
<generator class="native"/>
</id>
<property name="navn" column="NAVN" type="string" />
<property name="famnr" column="PERSONNUMMER" type="string" />
<property name="aksessert" column="AKSESSERT" type="timestamp" />
<property name="bruker" column="BRUKER_ID" type="integer" not-null="true" />
<property name="lopenrSak" column="LOPENR_SAK" type="integer" />
<property name="logiskSlettet" column="LOGISK_SLETTET_F" type="true_false" not-null="true" />
<!-- many-to-one name="bruker" column="BRUKER_ID" class="Bruker" /-->
<many-to-one name="kodeSakStatus" column="STATUS_K" class="xxx.kode.KodeSakStatus" not-null="true" />
<many-to-one name="kodeSakType" column="SAKSTYPE_K" class="xxx.kode.KodeSakType" />
<many-to-one name="kommune" column="KOMMUNE_NR" class="xxx.domain.BostotteKommuneDO" />
<component name="termin" class="xxx.domain.BostotteTerminDO">
<property name="termin" column="TERMIN" />
<property name="terminar" column="TERMIN_AR" />
</component>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
We use Spring:
hibernateTemplate.saveOrUpdate(sisteSak);
Full stack trace of any exception that occurs:
2005-10-27 10:22:05,649 INFO [STDOUT] Hibernate: insert into SISTE_SAKER (NAVN, PERSONNUMMER, AKSESSERT, BRUKER_ID, LOPENR_SAK, LOGISK_SLETTET_F, STATUS_K, SAKSTYPE_K, KOMMUNE_NR, TERMIN, TERMIN_AR) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding 'ET NAVN' to parameter: 1
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding '11093638489' to parameter: 2
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.TimestampType] binding '2005-10-27 10:22:05' to parameter: 3
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.IntegerType] binding '42' to parameter: 4
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.IntegerType] binding '0' to parameter: 5
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.TrueFalseType] binding 'false' to parameter: 6
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.engine.Cascades] id unsaved-value strategy NULL
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding 'J' to parameter: 7
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.engine.Cascades] id unsaved-value strategy NULL
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding 'O' to parameter: 8
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.engine.Cascades] id unsaved-value strategy NULL
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding '0807' to parameter: 9
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding '2' to parameter: 10
2005-10-27 10:22:05,649 DEBUG [net.sf.hibernate.type.StringType] binding '2005' to parameter: 11
2005-10-27 10:22:05,664 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] SQL Exception
com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -261: There is already a variable named '@p0'
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2538)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1922)
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.executeLoop(SybStatement.java:1667)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1659)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(SybPreparedStatement.java:580)
at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:230)
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:932)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)
at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:532)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529)
Name and version of the database you are using:
Sybase ASA 9.0.2.2451
This error only happens very rarely in our training environment. It is the same error every time reffering to the variable with the name @p0. Last time this happened we logged into the web application with the same user that got this error and tried to do an action that caused the same error. THe same thing happened. Other users have no problem inserting into the table. When we restarted JBoss, everything worked fine again. Does anyone know what might cause this? I have asked Sybase to help me out with this issue as well but I thougt might have som information on this here. Is there a way to put on some more logging so that we could see exactly when Hibernate is generating this variable.
|