Rick Hillegas-3 wrote
> 1) Something about the problem description is not clear. The first 
> tooMuchContention exception occurs within a half minute of booting the 
> database. It is very hard to understand how your application could chew 
> through 2 billion sequence numbers in that short time period. Perhaps 
> your identity column has already leaked its entire range due to setting 
> derby.language.sequence.preallocator to a high number and then crashing 
> without bringing the database down gracefully.

application is under stress test.



Rick Hillegas-3 wrote
> 2) From the stack traces, it appears that you are using Hibernate. Under 
> the covers, Hibernate calls a JDBC method which Derby does not support 
> but which, unfortunately, Derby does not reject either 
> (Statement.getGeneratedKeys()). That method causes contention on the 
> sequence generators which back identity columns. See 
> https://issues.apache.org/jira/browse/DERBY-6934. It is likely that you 
> have stumbled over this problem. You may be able to workaround this 
> problem by manually generating your object IDs yourself (e.g., by using 
> a sequence generator) and somehow forcing those object ids down through 
> the Hibernate api. I don't use Hibernate myself, so I don't know what 
> this entails. Maybe you will get better advice from someone who has 
> dealt with this Hibernate/Derby issue.

..so could this means that there is issue in hibernate? (meanwhile I will
try to google it :))

Nevertheless, I am currious about this tooMuchContetionException. It is
called in SequenceUpdater.getCurrentValueAndAdvance(..). However, this
method is synchonized. So concurrent generation of Ids should not be problem
(correct me if I am wrong). In method body there is comment


> ...Lock contention is possible if someone has selected from SYSSEQUENCES
> contrary to our advice. In that case, we raise a TOO MUCH CONTENTION
> exception.

I have one custom sequence in SYSSEQUENCES, and I am getting new value with
query "VALUES (NEXT VALUE FOR my_seq)". Could this be the problem, or there
could be some other? Besides this I am not using SYSSEQUENCES explicitly.



--
Sent from: 
http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html

Reply via email to