Hibernate version: 8.1.3
Hi all,
I've got a situation where I need to retrieve a list of persistent objects (which happen to use a composite primary key), remove some elements, update others, change unique/primary keys and then save it. I'd to have all inserts, updates and deletes within the scope of a transaction.
so basically
1. begin transaction
2. return list from query
3. delete one entry
4. update a non pk field on another
5. update a pk field on another
6. insert a new element with unique pk fields
7. save
8. commit transaction
it seems no matter what i try, i always get a warning in my log files:
WARN org.hibernate.cache.ReadWriteCache - An item was expired by the cache while it was locked (increase your cache timeout)
I'm using a composite key consisting of a string (groups elements by user) and a start date (unique for each user).
so basically an example could start with the following:
user: 1, start date: 01/02/2007, values: a
user: 1, start date: 02/02/2007, values: b
user: 1, start date: 03/02/2007, values: c
user: 1, start date: 04/02/2007, values: d
and end with the following:
user: 1, start date: 01/02/2007, values: a
user: 1, start date: 02/02/2007, values: c
user: 1, start date: 05/02/2007, values: d
or:
user: 1, start date: 01/02/2007, values: a
user: 1, start date: 05/02/2007, values: b
user: 1, start date: 06/02/2007, values: c
user: 1, start date: 07/02/2007, values: d
or:
user: 1, start date: 01/02/2007, values: a
user: 1, start date: 03/02/2007, values: c
user: 1, start date: 05/02/2007, values: b
user: 1, start date: 06/02/2007, values: c
user: 1, start date: 07/02/2007, values: d
if i were outside of hibernate it would be pretty simple; just a case of deleting all elements using the same where clause as the original query then inserting the elements now in the list.
PLEASE HELP!
|