I had faced an issue with the Oracle Sequences while using DB adapter in BPEL.
Just to give you a little background. I have a file adapter that polls for new files. The file contains only one record which I have to insert into database. During insertion I use the Native Sequencing to insert primary key into the table. My sequence is incremented by 1 with no cache specified.
Issue : After some loads I started getting the constraint voilation errors on the primary key.
Observation : Suppose my sequence was initially started by 1 then, now if I check the currval of the sequence in database it was 50 whereas the BPEL still is using values much lesser than that; which lets me come to an obvious conclusion that somehow weblogic is caching the sequence numbers.
After reading a lot of blogs I could understand that while configuring your database connections from Weblogic, weblogic by default keeps some values there for performance. The DBAdapter resource controlls the caching of the sequences using the sequencePreallocationSize parameter.
If anyone lands into the same issue then follow the following instruction
On the Weblogic Admin Console
- Click on Deployments -> DbAdapter
- Click on Configuration Tab
- Click on Outbound Connection Pools
- Expand the javax.resource.cci.ConnectionFactory
- Click on your own Connection Pool factory
- Modify parameter sequencePreallocationSize to 1
- Press Keyboard Enter and click on Save to save.
- Click on View changes and restarts to see if starts are requierd
No comments:
Post a Comment