java - JPA EntityManager limit number of concurrent operations on DB -
I am using the JPA framework to operate some databases.
First, I save the entity object to a specific table by using an and this continuous action is done with the method with annotaion I try to keep a large number of data in it using the loop in that method and all data is a transaction Nothing remains in it. Generally it all works well, but when I try to continue several rows, I have to face the problem and error. My DB supports about 32,000 concurrent tasks. Therefore there is no way in the JPA framework to specify the maximum number of concurrent actions. I think that you create your entities within the loop and EntityManagers is set to commit FlushModeType Which means that the EM waits for your deal, unless the database is sent to send / insert records. Even if you believe the EM is the maximum operating number, which has incorporated thousands of entities into one transaction (worst case scenario: even waiting for the committee's flat files to report transaction data Writing too) is definitely not a great idea. For any type of batch processing, or at least in this special case start with auto-recorded records made by FlushmodeType on auto. EntityManager object and then I use the code snippet
"EntityManager .persist (specialty) "
" @ transfer entry (TransactionAttributeType.REQUIRES_NEW) "< / Code>
"Operation record in the transaction coordinator Outsourcing (maxnowofconcurrent option) "
Comments
Post a Comment