batch « Transaction « JPA Q&A

1. Batch update returned unexpected row count from update

I have the following relationship:

// In class
@OneToMany(mappedBy="a", fetch=FetchType.LAZY)
private List<B> bList;

// In class
private A a;
I get this exception:
StaleStateException: Batch update returned unexpected row count from update
When I try to saveOrUpdate ...

2. How do I insert a lot of entities in a Play! Job?

In my application I have to simulate various situations for analysis. Thus insert a (very) large amount of lines into a database. (We're talking about a very large amount of data...several ...

3. Hibernate Java batch operation deadlock

We have J2EE application built using Hibernate and struts. We have RMI registry based implementation for business functionality. In our application around 250 concurrent users are going to upload batches containing ...

4. [Hibernate]Access Cache memory before BATCH commit

I want to access cache memory before batch commit in Hibernate. I am counting users up-to BATCH_SIZE then

if (countUsers == BATCH_SIZE) {
    countUsers = 0;

5. hibernate batch insert - how flush works?

I need to insert a lot of data in a database using hibernate, i was looking at batch insert from hibernate, what i am using is similar to the example on ...

6. Rollback issue with batch insert

Lets say i have 100 rows to insert and the 100th item has an error (eg a value to big for column). When the commit is executed an exception is thrown and rollback is called. However, the first 99 records are still being persisted to the database and not being rolledback. I am using an oracle database and running in a ...

7. Why no batch updates with optimistic concurrency

Hello, just wonder why it is not possible. The executeBatch on JDBC 2.0 PreparedStatement returns counts of updated rows, thus there is potential to check whether it succeeded or not. Optimistic concurrency is key concurrency approach (often the only usable one) in many applications. Just don't want to sacriface performance (batch updates) for this. BR, Marcel

8. Setting batch size to 0 for one transaction / session only?

[RMI TCP Connection(64)-] 2004-10-15 10:42:14,976 : ERROR - JDBCExceptionReporter.logExceptions : operation not allowed: streams type cannot be used in batching [RMI TCP Connection(64)-] 2004-10-15 10:42:14,977 : ERROR - JDBCException. : could not insert: [com.nimblefish.core.domain.function.Rule#4705] java.sql.SQLException: operation not allowed: streams type cannot be used in batching at oracle.jdbc.dbaccess.DBError.throwSqlException( at oracle.jdbc.dbaccess.DBError.throwSqlException( at ...

9. Batch processing in one transaction

I am trying to run a large data load in a single transaction based on the example: ... 8/27#batch When I run the code in a single transaction (which is important to us) the size of the Session grows continously despite the calls to clear, but when I commit the transaction and start a new one in addition to calling ...

10. batch commit with ConstrainViolationException

Hi, I have a requirement to use JTA transacation manager, batch commit and commit the batch even if ConstraintViolationException is thrown. Currently I am getting an exception during the commit of the batch, and the object identifier show it is the same object that is causing the unique constraint violation. "Row was updated or deleted by another transaction (or unsaved-value mapping ...

11. optimistic lock + delete + batch problem

12. jdbc batch size and pessimistic locking

13. Batch and commit. Can i define batch?

14. Memory use with transactional batch load

I am attempting to batch load about a hundred thousand rows via hibernate. I have followed the advice in section 13 and am flushing and clearing the session every hundred rows. I have also disabled the second level cache for the Session. Unfortunately, memory usage still increases rapidly as rows are inserted. Using jhat, I traced the memory use to references ...

15. Batch/bulk insert of entities w/o full rollback

Newbie Joined: Wed Jun 25, 2008 8:43 am Posts: 2 Location: Austria Hi, we're trying to do a bulk/batch insert of about 100000 objects uploaded via a web service (XFire) in packages containing 1000 objects. The environment is a JBoss application server with container managed persistence. At the moment, each single object is stored in the database in its own transaction, ...

16. Batch loads and transactions

Hibernate version: 3.2.6 Spring version: 2.5.3 Our product works on a batch of users to run a particular unit of work on each user. We envision a design were we are using the Hibernate batch load process (batch-size="10" specified in the .hbm) to retrieve a batch of say 10 users and then pass it to our "worker" that will then do ...