castor
  1. castor
  2. CASTOR-1247

After LockNotGrantedException an attempt to re-retrieve the object results in ObjectNotFoundException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.9
    • Fix Version/s: 0.9.9.1
    • Component/s: JDO
    • Labels:
      None
    • Environment:
      MySQL 4.0.25, Linux
    • Testcase included:
      yes
    • Number of attachments :
      5

      Description

      I am trying to retrieve the record CounterVar (id=4, type=1) - see mapping file description below - in one transaction. In the same program, with a different transaction, I am trying to retrieve the record CounterVar (id=1, type=1) in the DbLocked mode. Note that in both cases the type field references the same record. This results in my second transaction getting LockNotGrantedException (writeLockTimeout). When I rollback both transactions and retry the retrieve (in the context of the same process), I observed that the call to QueryResults.size() returns 1, but the call to QueryResults.hasMore() returns false. On further investigation, I found that the call to hasMore() sees the following exception stack trace:

      org.exolab.castor.jdo.ObjectNotFoundException: The object of type CounterVar with identity 1 was not found in persistent storage
      at org.exolab.castor.persist.LockEngine.load(LockEngine.java:385)
      at org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:651)
      at org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
      at org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:633)
      at org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:614)
      at TestWriteLockTimeout.main(TestWriteLockTimeout.java:84)

      In looking at the code, I see that LockEngine.load() is actually converting the exception ObjectDeletedWaitingForLockException into ObjectNotFoundException.

      I am guessing that this is happening because of the previous (unsuccessful) retrieve.

      1. bug1247.tar
        20 kB
        Vishal Madan
      2. output.txt
        2 kB
        Swagata De Khan
      3. patch.C1247.20051112.bug-report.txt
        19 kB
        Werner Guttmann
      4. patch.C1247.20051112.txt
        3 kB
        Werner Guttmann
      5. TestWriteLockTimeout.java
        5 kB
        Swagata De Khan

        Activity

        Hide
        Werner Guttmann added a comment -

        Thanks for the offer, but I think I'll do this myself, as I need to make up my mind where exactly to include this within the CTF.

        Show
        Werner Guttmann added a comment - Thanks for the offer, but I think I'll do this myself, as I need to make up my mind where exactly to include this within the CTF.
        Hide
        Werner Guttmann added a comment -

        Vishal, can I come back to your offer to supply me with a JUnit test case (based upon your re-write) ?

        Show
        Werner Guttmann added a comment - Vishal, can I come back to your offer to supply me with a JUnit test case (based upon your re-write) ?
        Hide
        Vishal Madan added a comment -

        Sure. I am a little swamped right now, but I should be able to write it for you in the next couple of days.

        Show
        Vishal Madan added a comment - Sure. I am a little swamped right now, but I should be able to write it for you in the next couple of days.
        Hide
        Vishal Madan added a comment -

        For whatever reason I am unable to figure out how to attach something to this report. I know it is possible because I've done it before!! Werner.... HELP! Or I could just e-mail it to you?

        Show
        Vishal Madan added a comment - For whatever reason I am unable to figure out how to attach something to this report. I know it is possible because I've done it before!! Werner.... HELP! Or I could just e-mail it to you?
        Hide
        Ralf Joachim added a comment -

        Vishal, as this issues is closed you can not attach new files to it. If you found that the original issue has not been resolved it should be reopened which would allow you to attach new files thereafter. If you found something that relates to the original issue or you have created a test case I suggest to create a new issue and link it to this one as related.

        Show
        Ralf Joachim added a comment - Vishal, as this issues is closed you can not attach new files to it. If you found that the original issue has not been resolved it should be reopened which would allow you to attach new files thereafter. If you found something that relates to the original issue or you have created a test case I suggest to create a new issue and link it to this one as related.

          People

          • Assignee:
            Werner Guttmann
            Reporter:
            Vishal Madan
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 20 minutes
              20m