Ok guys,
Let's say I have a POJO type called Foo, in my code, I have in several different calls built up a Collection of proxies and/or read instances of Foos:
final Collection<Foo> foos = ...
Further down in the code, I want to do the following:
with ONE operation, do a Session.refresh with LockMode.UPGRADE_NOWAIT on ALL foos contained in a collection (foos in this example).
Like this:
refreshAndLockAll(foos);
This _needs_ to be done in a one-shot operation, because I do not wish to acquire the locks separately as so:
for(Foo foo : foos)
session.refresh(foo,LockMode.UPGRADE_NOWAIT);
Note that it is absolutely vital that the conditions stipulated here are not changed:
1) a collection of Foo already exists, these can be either proxied entities and/or populated entitities. (though all are persisted previously (they are not transient))
2) a refresh-operation with LockMode.UPGRADE_NOWAIT has to be obtained with a one-shot operation that does both the refresh and the lock on _all_ the entities.
Is this possible?
Cheers,
57451
Hibernate version: 3.2
Mapping documents: plain mapped POJO
Code between sessionFactory.openSession() and session.close():
Not relevant
Full stack trace of any exception that occurs:
None available
Name and version of the database you are using:
Confidential
The generated SQL (show_sql=true):
Not applicable
Debug level Hibernate log excerpt:
Not applicable
|