James Sutherland wrote:If you are using EclipseLink, you can use a sequence connection pool...
James Sutherland wrote:Also use a large sequence pre-allocation size.
James Sutherland wrote:For a sequence connection pool you don't need another persistence unit. You do need a non-JTA data-source, but most servers allow you to use the same connection pool for JTA and non-JTA.
James Sutherland wrote:For the pre-allocation, a bigger size is recommend if you do lost of inserts. Note that for IDENTITY sequencing the id must be selected on every insert, so your ratio of 1:50 would be 50:50 for IDENTITY, TABLE sequencing is much more efficient.
James Sutherland wrote:Not sure why you would be worried about losing 50 sequence numbers on a restart?
James Sutherland wrote:For a sequence connection pool you don't need another persistence unit. You do need a non-JTA data-source, but most servers allow you to use the same connection pool for JTA and non-JTA.
Per Lindberg wrote:
Aha, ok. So in the example below, I just have to change non-transactional-connections from "false" to "true", and that's it?
James Sutherland wrote:Yes, you should configure a sequence connection pool that uses a non-JTA DataSource.
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|