Questions tagged [hibernateexception]
38 questions
84
votes
23 answers
Hibernate: How to fix "identifier of an instance altered from X to Y"?
org.hibernate.HibernateException: identifier of an instance
of org.cometd.hibernate.User altered from 12 to 3
in fact, my user table is really must dynamically change its value, my Java app is multithreaded.
Any ideas how to fix it?

gennad
- 5,335
- 12
- 44
- 47
41
votes
3 answers
org.hibernate.QueryException: could not resolve property: filename
I am using Hibernate Criteria to get values from column filename in my table contaque_recording_log.
But when I'm getting the result, it throws an exception
org.hibernate.QueryException: could not resolve property: filename of:…

earthmover
- 4,395
- 10
- 43
- 74
7
votes
1 answer
Extract field name causing ConstraintViolationException
How can I get field name causing org.hibernate.exception.ConstraintViolationException?
The only sure way to check unique constraint is transaction commit, so even if I check it before the exception can be thrown. So I need to communicate to user…

Saram
- 1,500
- 1
- 18
- 35
5
votes
2 answers
Hibernate - how to catch "integrity constraint violation: unique constraint or index violation"
In my table I have a unique constraint.
In hibernate, when I add an item that violates that constraint, I want to catch it, so It will update instead of create an item.
When I set no try-catch block around
updated = query.executeUpdate();
it…

Ken Vernaillen
- 859
- 1
- 7
- 37
4
votes
5 answers
Hibernate and MySQL configuration
I have spent a few hours trying to set up my first Hibernate application and it still doesn't work.
I have WAMP Server with my MySQL Data Base called "hibernatetest". I have Project in Eclipse, which contains Hibernate library, and…

G.Spansky
- 852
- 6
- 17
- 32
3
votes
1 answer
FUSE hibernate application throws No Session found for current thread exception
I'm working on simple demonstration of Hibernate on FUSE server and I found this sample code example in this github location.
I'm try to run this code in FUSE 6.3 with Hibernate 4 integration I was able to install all the required dependencies but…

casper
- 535
- 5
- 13
3
votes
1 answer
Hibernate Exception - Initial SessionFactory creation failed.java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
I have tried to establish a hibernate connection with Postgresql, but I'm receiving an exception, as follow:
Caused by: java.lang.NoSuchMethodError:
javax.persistence.Table.indexes()[Ljavax/persistence/Index; at
…

Douglas Marques
- 31
- 2
3
votes
3 answers
NHibernate.HibernateException: No session bound to the current context
I am getting this error when I am trying to get the CurrentSession
NHibernate.Context.CurrentSessionContext.CurrentSession()
at
NHibernate.Impl.SessionFactoryImpl.GetCurrentSession()

Miral
- 5,968
- 16
- 57
- 85
2
votes
2 answers
Multiple datasources causing HibernateException?
For my grails project, I have an in-memory h2 database for most of my classes, but just added a persistent database for all User-related classes. On startup, the app executes several threads. After adding the second datasource, I'm getting…

Justin
- 680
- 1
- 8
- 16
1
vote
1 answer
NHibernate Tutorial Run-Time Error: HibernateException
I'm a newbie at NHibernate so please go easy on me if I have asked a stupid question...
I am following the tutorial for NHibernate posted here and am getting a run-time error of type "HibernateException"
The code in question looks like this:
using…

Kashif
- 865
- 2
- 12
- 33
1
vote
2 answers
HibernateException on session.buildLockRequest with byte[] as primary key
I have a user and credit_card entity, user has a collection of credit_card. The primary key for both of these entities i have is a byte[].
First session:
- I opened a new session.
- Do criteria query on the users table, which actually goes to the…

sheoran
- 11
- 2
1
vote
3 answers
How do these Hibernate objects differ?
Possible Duplicate:
Hibernate: different object with the same identifier value was already associated with the session
Why does some objects I get in Hibernate exceptions appear like this when they are printed out with the @ symbol:
Cannot remove…

Rihards
- 10,241
- 14
- 58
- 78
1
vote
0 answers
Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
I have an application which contains a webservice that use Spring and hibernate in order to retrieve data from database.
Other applications invoke this webservice in their application.
The flow of webservice :
Webservice class method (calls manager…

nagaraju
- 31
- 1
- 4
1
vote
0 answers
Any way to suppress Hibernate "More than one row with the given identifier" exception?
In our domain model, one Event is designed to have zero or one Notification, so I started to use @OneToOne annotation for entity relation:
class Event {
...
@OneToOne(mappedBy = "event")
Notification notification;
In most cases it works…

Alex Salauyou
- 14,185
- 5
- 45
- 67
1
vote
1 answer
EntityNotFoundException: deleted entity passed to persist
I try to delete one row in my table:
My page:

The Nightmare
- 701
- 5
- 16
- 36