posted 6 years ago
I am inserting some records in Oracle DB. For the uniqueness, I am using SequenceGenerator. Below is the code:
XxspPoInLineLocqty is having @ManyToOne relation with XxspPoInLine. When I am persisting XxspPoInLine entity, I am receiving below error:
I looked on the internet and found some solutions for this:
1. Use allocationSize=1
Since I am having 5000+ XxspPoInLineLocqty , this would be the worst option I could apply. I tried this as well but after 40min my network got fluctuate and persisting got failed. I cannot use this option as it degrade the performance.
2. Increse the value of allocation size I increased the allocationSize=500, but still faced the same issue at different identifier(#372).
Even tried GenerationType.AUTO, but no luck.
Below is the sequence I am using:
I am still confused why this issue is coming up. I didn't understand the root cause of this. Can someone explain me the root cause of this exception, and what should be the work around?
Note : Before inserting the records, I deleted all the rows from table. So the table is blank when I execute the above sequnce code.