load « Transaction « JPA Q&A





1. session.load without lock options returns empty object    forum.hibernate.org

I have recently upgraded to 3.5.6 and I came across a small delete query in my application which is not working anymore..where im trying to delete a record. Line1 MyInstance reportInstance = (MyInstance ) HibernateUtility.currentSession().load(MyInstance .class, reportInstanceId); Line2 HibernateUtility.currentSession().delete(reportInstance); Line 1 can not find the actual record from the DB (tried MSSQL, Oracle) so can not delete but if I use ...

3. session.load seems to load all ancestors causing deadlocks    forum.hibernate.org

Hello, Recently, I turned on the show_sql and started observing this behavior. I would like to confirm whether this is supposed to happen and curious to know how to optimize it. Currently, I am facing severe deadlock issues. I need to resolve this ASAP and I greatly appreciate your time and help. I have typical bidirectional one-to-many with the many-valued end ...

4. session.refresh() and session.load() using pessimistic lock    forum.hibernate.org

Hibernate version:2.1.6 Mapping documents: ...

5. Hibernate.load from cache slow when outside transaction    forum.hibernate.org

I'm using Hibernate 3.0.5 and I've run into a performance problem with Session.load when retrieving objects from the session-level cache. It seems the problem is that when running outside a transaction, each time an object is retrieved from the cache Hibernate iterates through every single item in the cache and sets the lock mode to LockMode.NONE. Is this step necessary, and ...

7. Transaction, load and rollback    forum.hibernate.org

1. All data access (read/write) works inside a hibernate transaction for an active session. So I dont think your load will work if you dont put it inside transaction. 2. You would usually write your beginTransaction and commit/rollback in a centralized place. When there is no exception commit would happen and if there is an exception which needs rollback then you ...

8. hibernate locks up under moderate load    forum.hibernate.org

Newbie Joined: Wed Sep 27, 2006 6:10 pm Posts: 8 our system is a pretty low load system. i am in the process of writing junit tests that perform regression testing. my problem is when the test runs, it really pounds the hibernate system validating that the correct data was written to the database. it gets about 7 or 8 queries ...

9. Loading/Commit-options in transactions    forum.hibernate.org

Newbie Joined: Wed Feb 06, 2008 6:26 am Posts: 1 Im coming from ejb 2.x and jboss application server. I know that there are different commit-options for the cmp-engine (see below, its part of ejb-spec). For example if the container knows that its the only one db-user its not necessary to synchronize the states of container and db between transactions. So ...





10. Concept to handle concurrent tx in a high load scenario    forum.hibernate.org

Hello, I have got problems with occuring database deadlocks in my application while it's under heavy load. I discovered this fact while doing load tests with the tool "The Grinder". Our configuration is as follows: - Hibernate 3.2.1ga - Oracle 10g - Jboss 4.0.1SP1 I searched this forum about topics which treat similar problems and found many different "very technical" topics. ...

11. Save and load an object multiple times in same transaction    forum.hibernate.org

Hello, What sould hibernate do in a situation like this to the result object? Code: //transaction, session, and identifier declared above int i=0; while (i < 10) { Thing result = (Thing) session.load("Thing", identifier); //the following changes a field in the result object. result.incrementNumber(); session.saveOrUpdate(result); i++; } //close session and transaction ...

12. Save and load an object multiple times in same transaction    forum.hibernate.org

Hello, What sould hibernate do in a situation like this to the result object? Code: //transaction, session, and identifier declared above int i=0; while (i < 10) { Thing result = (Thing) session.load("Thing", identifier); //the following changes a field in the result object. result.incrementNumber(); session.saveOrUpdate(result); i++; } //close session and transaction ...

13. URGENT,Concurrency issue,loads the session attached to proxy    forum.hibernate.org

When we have multiple threads concurrently running, we have an issue with proxy objects. Meaning when a thread a trying to access a domain object, it is loading the proxy object that is attached to a different session. I do not see any reason why it loads the other session instead of loading the object into the same session. So I ...

14. Locking related table when loading    forum.hibernate.org

@Entity @Table(name="shop_round") public class ShoppingRound extends HibernateEntity { @Column(name="shopping_time", nullable = false) private long shoppingTime; ... ... ... ... /** * The ShoppingDetailss of this ShoppingRound. */ ...

15. Committed update is not applied to already loaded object    forum.hibernate.org

Consider the following transactions with isolation level = READ_COMMITTED. Tx-1 T1: Get object with id = 1. Returned object has name = "X" T2: Sleep for 10 sec T3: Get object with id = 1, Returned object has name = "X" Tx-2 T2: Update name of object id = 1 to "Y" Why is Hibernate not updating the name to "Y"? ...