Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Unnati Redkar

+ Follow
since May 14, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Unnati Redkar


I have a view (used to ONLY fetch and display data) and table (used for INSERTS and UPDATES)

Following is the mapping in hibernate mapping file , both table and view are mapped to same POJO but underlying table are different.
name="" entity-name="AccountTOView"
name="" entity-name="AccountTO"

When i do a batch update (Object update -HibernateSession.update(AccountTO, obj); ) , few records get updated OK and then hibernate throws following exception :

cannot modify a column which maps to a non key-preserved table
2011-05-14 23:09:49,320 INFO [STDOUT] 14 May 2011 23:09:49,305 [DefaultQuartzScheduler_Worker-5] ERROR org.hibernate.event.def.AbstractFlushingEventListener []: Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: could not update: [AccountTOView#452283]

Am using Spring's HibernateTemplate to do the update.

Any directions to get rid off this exception will be a great help, looks like a weird behaviour, since few records are updated fine.
Is it hibernate session behaviour which is looking for AccountTOView even when update should be ideally done via AccountTO which is mapped to CST_HDR table ?



Have no clue what is wrong with starting my tomcat server 5.5.31. Had a tomcat version 5.5.26 working all fine. No idea what network setting has changed and it fails to start complaining

SEVERE: Error initializing endpoint
java.lang.Exception: Socket listen failed: [730022] An invalid argument was supp

Down the stack trace continues as ...

SEVERE: Error starting endpoint
java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket
address (protocol/network address/port) is normally permitted.

Machine settings and environment :

OS - Windows XP 32-bit
Environment Variables - Tried with CATALINA_HOME set to tomcat installation directory and tried without setting CATALINA_HOME

Did following :
1. Tried changing the port number to 8090, 8010... but to no avail.
2. Downloaded 5.5.31 and still complains the same.

Awaiting help ASAP !!!
11 years ago

Looking at updating an hibernate composite key object for modified either or all of the composite key fields. I tried :

1. load the object.
2. create new object for new composite key values.
3. set the not null fields for new object from the old t this new object
including the associations, while making the primary id of each associate
object as null - since the id generator: class=increment for all of these
4. hibernate.update(new object)
5. delete the old object : hibernate.delete(old obect)

This gives me an error message : failed to lasily initialise the association.
If i comment the piece of code for setting null for primary keys of the all the associations for the new object - constarint violation exception is thrown.

What am i missing? will my update for composite key, update the corresponding associations as well for their new updated foreign key ?

Is it that HQL has the limitation that joins between tables cannot be established in a query, which are not related to each other using PK/FK relationship?
If it can be done, can i have a sample example HQL query.

Hi ,

i am trying to figureout the significance of empty/marker classes in java.
In what scenario are they used?
14 years ago