-->
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.  [ 3 posts ] 
Author Message
 Post subject: Duplicate Key & AssertionFailure
PostPosted: Tue Sep 09, 2003 12:59 pm 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
After a duplicate key error
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Vio
lation of UNIQUE KEY constraint 'IX_PERSON2'. Cannot insert duplicate key in obj
ect 'PERSON2'.

Which is correct (I really wanted to get this error)

I have this error, on the app-server console:

GRAVE: An AssertionFailure occured - this may indicate a bug in Hibernate
net.sf.hibernate.AssertionFailure: null identifier
at net.sf.hibernate.engine.Key.<init>(Key.java:20)
at net.sf.hibernate.engine.Key.<init>(Key.java:29)
at net.sf.hibernate.impl.SessionImpl.evict(SessionImpl.java:3117)
at it.saga.library.commonDataTypes.CdtBLGPkBaseClassBean.closeSession(Cd
tBLGPkBaseClassBean.java:587)
at it.saga.library.commonDataTypes.CdtBLGPkBaseClassBean.save(CdtBLGPkBa
seClassBean.java:266)
at testCDT.impl.CdtBLGTestPersonBean.save(CdtBLGTestPersonBean.java:161)

at CdtBLGTestPerson_StatelessSessionBeanWrapper6.save(CdtBLGTestPerson_S
tatelessSessionBeanWrapper6.java:530)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
utor.java:803)
at java.lang.Thread.run(Unknown Source)

Regards
Alessandro Rizzi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 10:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Heh. Or it may indicate that you are trying to reuse the session after an exception occurs. This is outlawed.


(I should change that message.)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 11:23 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
The problem was that I made an evict(obj) ...
This evict was in a finally block so it was executed after the exception was throw ... but I check if the session was still opened ...
By the way ... I do not need that evict, I removed and all was Ok.
But I though you'd like to know that this appended
Bye
Alessandro


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