Results 1 to 5 of 5
  1. #1
    Arun_N is offline Member
    Join Date
    May 2011
    Posts
    21
    Rep Power
    0

    Default What is the timeout period for the record lock introduced by SELECt FOR UPDATE?

    What is the timeout period for the record lock introduced by SELECt FOR UPDATE? How to unlock the lock during connection crash in the middle?
    If we are use Select For Update in the method the whole records selected will be locked and waiting for update by the same connection. when due to some system crashes if we lose that connection. we cant unlock the records locked, if we are not db admins.
    How we can release a lock in the case of system crashes in the middle.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,763
    Blog Entries
    7
    Rep Power
    21

    Default Re: What is the timeout period for the record lock introduced by SELECt FOR UPDATE?

    That is the responsibility of the database; when it notices that a connection is gone it should clean up, i.e. get rid of the resources held by the connection (that includes the locks) and possibly do a roll back on the latest aborted transaction.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Arun_N is offline Member
    Join Date
    May 2011
    Posts
    21
    Rep Power
    0

    Default Re: What is the timeout period for the record lock introduced by SELECt FOR UPDATE?

    @Josah

    But when that connection is lost i was not able to retrieve those rows again. they were locked.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,763
    Blog Entries
    7
    Rep Power
    21

    Default Re: What is the timeout period for the record lock introduced by SELECt FOR UPDATE?

    Maybe your database waits a bit until a connection is re-established; I don't know the details of your database, check its user manual., but keeping those records locked forever is just silly. This is not a Java question b.t.w.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: What is the timeout period for the record lock introduced by SELECt FOR UPDATE?

    Moved from Advanced Java.

    Agreed that it's not a Java question, but JDBC is the closest fit. In future, please find a database forum for your non-Java questions.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 9
    Last Post: 07-09-2011, 08:15 PM
  2. Record Lock in Java
    By sfaisalawan in forum JDBC
    Replies: 1
    Last Post: 05-08-2011, 09:10 AM
  3. Name was not previously introduced as per JSP.5.3
    By miko5054 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 09-28-2010, 11:54 PM
  4. How to reserve/lock a record/object for update
    By Steve11235 in forum Java Tip
    Replies: 0
    Last Post: 01-12-2009, 04:46 PM
  5. Update a record in Random access file
    By Rgfirefly24 in forum New To Java
    Replies: 2
    Last Post: 04-24-2008, 11:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •