db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Bortnovskiy <pbortnovs...@jefferies.com>
Subject RE: Derby Locks - best practices
Date Fri, 01 Jun 2012 23:50:13 GMT
Thank you, Dag.

So, what may be my best strategy in the described situation? Let me recap a case like such:

Say Derby is running in in-memory subprotocol. There are two tables and three threads. Two
threads perform inserts/deletes/updates and merges (implemented as update+insert) on each
corresponding table. And the third thread runs an SQL on those two tables. I forgot to mention
a few details:
- the threads perform table updates in a batched way: Prepared statements are created and
then they are batched. At a certain the batches are executed
- the SQL is very slow running - for argument sake, it may take 3-4 mins to run it - much
longer than a lock timeout.

What would be the best way to assure proper functioning of the app and avoid timeouts?

It has been suggested to repeat a transaction if a lock time out exception is caught, but
that would mean to execute the whole batch again...

Thank you for your help,


-----Original Message-----
From: Dag H. Wanvik [mailto:dag.wanvik@oracle.com]
Sent: Friday, June 01, 2012 7:30 PM
To: Derby Discussion
Subject: Re: Derby Locks - best practices

Pavel Bortnovskiy <pbortnovskiy@jefferies.com> writes:

> 1)      What's the default length of lock timeouts?

60 seconds.

cf. http://db.apache.org/derby/docs/10.8/ref/rrefproper46141.html
Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email,
including any attachments, are confidential to the ordinary user of the email address to which
it was addressed. If you are not the addressee of this email you may not copy, forward, disclose
or otherwise use it or any part of it in any form whatsoever. This email may be produced at
the request of regulators or in connection with civil litigation. Jefferies accepts no liability
for any errors or omissions arising as a result of transmission. Use by other than intended
recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International
Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames
Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the
Financial Services Authority.

View raw message