WRITE « Transaction « JPA Q&A





1. How do I write an application that more or less acts as a container?    stackoverflow.com

I am planning an application that must provide services that are very much like those of a JEE container to third party extension code. Basically, what this app does is ...

2. whats the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE?    stackoverflow.com

I have read the article Locking and Concurrency in Java Persistence 2.0, and run the sample application. But i still cant realize the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE. I ...

3. Is LockModeType.PESSIMISTIC_WRITE sufficient for an UPSERT in JPA?    stackoverflow.com

I've read this article on JPA concurrency, but either I am too thick or it is not explicit enough. I am looking to do a database-controlled atomic update-if-found-else-insert operation (an ...

4. hibernate transaction (read one row as inprog, write to other table) (read other table, set row to notinprog)    stackoverflow.com

I am new to hibernate and transactions. I have a row in a table that marks it as in-progress state. I have a second table that is used to write rows ...

5. how to write junit test for save method without transaction?    forum.hibernate.org

how to write junit test for save method without transaction? it seems test codes runs well, but it didn't save to database. ======================================== public void testSaveOrUpdate() { try { PigeonholeType pigeonholeType = new PigeonholeType(); pigeonholeType.setSymbol("none"); PigeonholeRule pigeonholeRule = new PigeonholeRule(); pigeonholeRule.setXtypeSymbol("SB006"); pigeonholeRule.setSize(new Integer(456)); pigeonholeRule.setPigeonholeType(pigeonholeType); pigeonholeRuleDao.saveOrUpdate(pigeonholeRule); } catch (Exception e) { e.printStackTrace(); } PigeonholeRule obj = pigeonholeRuleDao.loadByPrimaryKey("SB006"); System.out.println(obj.getSize()); Xtype xtype = xtypeDao.loadByPrimaryKey("SB006"); ...

6. Hibernate 3.1rc2 + JTA + bean not writing to the database    forum.hibernate.org

Newbie Joined: Wed Jan 04, 2006 10:01 pm Posts: 17 Hello, I am having a strange behavior when running hibernate code in an mbean. Reading from the database is working fine. Writing to the database does not write. Although things works perfectly under the debugger. Below is the piece of code I used - to be clear, exception handling code has ...

7. Read-write cache only works with single transaction/session?    forum.hibernate.org

I am using hibernate 3.1. I have multiple transactions in each session. It seems that the items I put into the cache are only gettable for those sessions created later. It looks pretty weird to me that the DefaultLoadEventListener.loadFromSecondLevelCache(LoadEvent, EntityPersister, LoadType) uses the session timestamp as a transaction timestamp and passes it to ReadWriteCache.get(Object key, long txTimestamp). This prevents my loading ...

8. JTA+Hibernate3.1.2+JBossAS 4.03 not writing data to database    forum.hibernate.org

Searching this problem in the forum, this problem is repeated time by time. But it isn't solved actually, so I have to ask it for the N time. Frankly speaking, I'm a newbie to hibernate and jboss. But I must have this problem solved before the next step of my study. The problem is that the data isn't written to the ...





10. Exclusive read and write table lock    forum.hibernate.org

Hi, i am using Hibernate 3.2 JPA. Because of massive concurrent access on my program i have to use a table lock. At some point in a transaction i want to lock a whole table for the current transaction and remove this lock not until commit. Other transactions that try to access this tables should wait until there is no lock. ...

11. Read and write in the same transaction problem    forum.hibernate.org

Hy guys, I use Hibernate with Spring management of transactions. Pojos and home classes generated with Hibernate Tools. I would like to make that : 1. Begin transaction 2. Create data in DB (in fact in transaction) 3. Read data created/existing in transaction and in DB 4. Rollback the transaction The goal is to emulate the running of a process of ...

12. read/write locking of Hibernate collections    forum.hibernate.org

I'm working on an app that gets a collection from a single Hibernate session and uses it, in read-only fashion, across many threads in a Terracotta cluster. (E.g., our perf tests hammer on this object with 20k users simultaneously.) I've seen many posts here explaining that sessions are not threadsafe and that it is necessary to add synchronization code in the ...

13. Write transaction sends unnecessary updates    forum.hibernate.org

...