A lock could not be obtained within the time requested

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

A lock could not be obtained within the time requested

byersa
I get this error inside my custom checkout code. The mail list archives from
a year ago suggest that it might be a Derby problem, so I got the latest
version with the same result. Is it most likely still a Derby problem or is
it because the code that I am calling, CheckoutHelper.processPayment is
doing a query on the OrderHeader table inside of a transaction that has
already locked OrderHeader? Is calling processPayment from a service a way
to fix this? I realize that I could try various fixes, but I believe that
situations like this are a great opportunity to share knowledge. So start
sharing.

Thanks,

-Al
Reply | Threaded
Open this post in threaded view
|

Re: A lock could not be obtained within the time requested

David E Jones-2

Do you have any more information about where this is happening and  
what the exact error message (with log traces, etc) is?

Unless by chance someone knows exactly what you're alluding to, that  
might be necessary to get this party started... ;)

-David


On Oct 17, 2006, at 7:01 PM, Al Byers wrote:

> I get this error inside my custom checkout code. The mail list  
> archives from
> a year ago suggest that it might be a Derby problem, so I got the  
> latest
> version with the same result. Is it most likely still a Derby  
> problem or is
> it because the code that I am calling,  
> CheckoutHelper.processPayment is
> doing a query on the OrderHeader table inside of a transaction that  
> has
> already locked OrderHeader? Is calling processPayment from a  
> service a way
> to fix this? I realize that I could try various fixes, but I  
> believe that
> situations like this are a great opportunity to share knowledge. So  
> start
> sharing.
>
> Thanks,
>
> -Al

Reply | Threaded
Open this post in threaded view
|

Re: A lock could not be obtained within the time requested

Brett Palmer-2
In reply to this post by byersa
Al,

This scenario sounds like a lock on a table from a previous transaction.  I
think Derby does table locking and not row level locking.  You may not have
the same problem with a different database.

I like using services because in most cases you don't have to worry about
coding the transaction, it is done for you in the service engine.

Do you know where the first transaction lock on the table is occurring?  The
service will also lock if another process has already begun a transaction
and not committed it.


Brett

On 10/17/06, Al Byers <[hidden email]> wrote:

>
> I get this error inside my custom checkout code. The mail list archives
> from a year ago suggest that it might be a Derby problem, so I got the
> latest version with the same result. Is it most likely still a Derby problem
> or is it because the code that I am calling, CheckoutHelper.processPaymentis doing a query on the OrderHeader table inside of a transaction that has
> already locked OrderHeader? Is calling processPayment from a service a way
> to fix this? I realize that I could try various fixes, but I believe that
> situations like this are a great opportunity to share knowledge. So start
> sharing.
>
> Thanks,
>
> -Al
>