[Database Error] A lock could not be obtained within the time requested

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Database Error] A lock could not be obtained within the time requested

Chatree Srichart
I try to insert data to data base about 200 records. But I got some error
message look like database lock problem.

This is the exception:

---- exception report
----------------------------------------------------------
Failure in findOne operation for entity [Product]:
org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing
the following:
...
...
...
--- cause
---------------------------------------------------------------------
Exception: org.apache.derby.iapi.error.StandardException
Message: A lock could not be obtained within the time requested
---- stack trace
---------------------------------------------------------------
ERROR 40XL1: A lock could not be obtained within the time requested
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
Source)
org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown
Source)
org.apache.derby.impl.store.raw.xact.RowLocking2.lockRecordForRead(Unknown
Source)
org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
Source)
org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
Source)
org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
Source)
org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
Source)

Can any one help me what I have to do for fix this?

Regards,
Chatree Srichart
Reply | Threaded
Open this post in threaded view
|

Re: [Database Error] A lock could not be obtained within the time requested

BJ Freeman
derby is a test db not used for production.
how were you inserting?
what resources on the machine your running ofbiz on
Cpu usage, memory.

Chatree Srichart sent the following on 8/4/2010 4:42 AM:

> I try to insert data to data base about 200 records. But I got some error
> message look like database lock problem.
>
> This is the exception:
>
> ---- exception report
> ----------------------------------------------------------
> Failure in findOne operation for entity [Product]:
> org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing
> the following:
> ...
> ...
> ...
> --- cause
> ---------------------------------------------------------------------
> Exception: org.apache.derby.iapi.error.StandardException
> Message: A lock could not be obtained within the time requested
> ---- stack trace
> ---------------------------------------------------------------
> ERROR 40XL1: A lock could not be obtained within the time requested
> org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
> Source)
> org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
> org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown
> Source)
> org.apache.derby.impl.store.raw.xact.RowLocking2.lockRecordForRead(Unknown
> Source)
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> Source)
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> Source)
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>
> Can any one help me what I have to do for fix this?
>
> Regards,
> Chatree Srichart
>
Reply | Threaded
Open this post in threaded view
|

Re: [Database Error] A lock could not be obtained within the time requested

Scott Gray-2
In reply to this post by Chatree Srichart
It generally means you're either doing something to cause a deadlock between two transactions or otherwise one transaction is being forced to wait too long for another transaction's lock to be released.
If you're not sure what is causing the problem then you can uncomment the debugging lines in derby.properties to see in the logs which thread/transaction is blocking and which is left waiting.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 4/08/2010, at 11:42 PM, Chatree Srichart wrote:

> I try to insert data to data base about 200 records. But I got some error
> message look like database lock problem.
>
> This is the exception:
>
> ---- exception report
> ----------------------------------------------------------
> Failure in findOne operation for entity [Product]:
> org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing
> the following:
> ...
> ...
> ...
> --- cause
> ---------------------------------------------------------------------
> Exception: org.apache.derby.iapi.error.StandardException
> Message: A lock could not be obtained within the time requested
> ---- stack trace
> ---------------------------------------------------------------
> ERROR 40XL1: A lock could not be obtained within the time requested
> org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
> Source)
> org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
> org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown
> Source)
> org.apache.derby.impl.store.raw.xact.RowLocking2.lockRecordForRead(Unknown
> Source)
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> Source)
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> Source)
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>
> Can any one help me what I have to do for fix this?
>
> Regards,
> Chatree Srichart


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Database Error] A lock could not be obtained within the time requested

Chatree Srichart
Oh I see. I set require-new-transaction="true" at service definition.

Thanks a lot

Regards,
Chatree Srichart

On Thu, Aug 5, 2010 at 3:45 AM, Scott Gray <[hidden email]>wrote:

> It generally means you're either doing something to cause a deadlock
> between two transactions or otherwise one transaction is being forced to
> wait too long for another transaction's lock to be released.
> If you're not sure what is causing the problem then you can uncomment the
> debugging lines in derby.properties to see in the logs which
> thread/transaction is blocking and which is left waiting.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 4/08/2010, at 11:42 PM, Chatree Srichart wrote:
>
> > I try to insert data to data base about 200 records. But I got some error
> > message look like database lock problem.
> >
> > This is the exception:
> >
> > ---- exception report
> > ----------------------------------------------------------
> > Failure in findOne operation for entity [Product]:
> > org.ofbiz.entity.GenericDataSourceException: SQL Exception while
> executing
> > the following:
> > ...
> > ...
> > ...
> > --- cause
> > ---------------------------------------------------------------------
> > Exception: org.apache.derby.iapi.error.StandardException
> > Message: A lock could not be obtained within the time requested
> > ---- stack trace
> > ---------------------------------------------------------------
> > ERROR 40XL1: A lock could not be obtained within the time requested
> > org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
> > org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
> > Source)
> > org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown
> Source)
> > org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown
> > Source)
> >
> org.apache.derby.impl.store.raw.xact.RowLocking2.lockRecordForRead(Unknown
> > Source)
> > org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> > Source)
> > org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown
> > Source)
> >
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> > Source)
> >
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> > Source)
> >
> > Can any one help me what I have to do for fix this?
> >
> > Regards,
> > Chatree Srichart
>
>