castor
  1. castor
  2. CASTOR-2550

When database constraint is violated at db.create() a NullPointerException gets thrown at SQLStatementLookup

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2, 1.3 rc1
    • Fix Version/s: 1.3
    • Component/s: JDO
    • Labels:
      None
    • Number of attachments :
      2
    1. patch-C2550-20081003.txt
      6 kB
      Ralf Joachim
    2. patch-C2550-20081013.txt
      10 kB
      Ralf Joachim

      Activity

      Hide
      Ralf Joachim added a comment -

      Problem doesn't happen with MySQL using no key generator. Maybe it only happens with Oracle using sequence only where I originally discovered it.

      Show
      Ralf Joachim added a comment - Problem doesn't happen with MySQL using no key generator. Maybe it only happens with Oracle using sequence only where I originally discovered it.
      Hide
      Ralf Joachim added a comment -

      Test case that I used to when trying to reproduce problem with mysql. As already c ommented I could not reproduce and need to try this with oracle.

      Show
      Ralf Joachim added a comment - Test case that I used to when trying to reproduce problem with mysql. As already c ommented I could not reproduce and need to try this with oracle.
      Hide
      Ralf Joachim added a comment -

      It took me a while to find out how to reproduce the problem. It happens when identity of the entity to be created is generated by the database (e.g. by a sequence). In this case the identity is null and we can not do the duplicate identity check with SQLStatementLookup.

      Final patch fixes this and includes a test case to verify that things work at oracle.

      Show
      Ralf Joachim added a comment - It took me a while to find out how to reproduce the problem. It happens when identity of the entity to be created is generated by the database (e.g. by a sequence). In this case the identity is null and we can not do the duplicate identity check with SQLStatementLookup. Final patch fixes this and includes a test case to verify that things work at oracle.

        People

        • Assignee:
          Ralf Joachim
          Reporter:
          Ralf Joachim
        • Votes:
          0 Vote for this issue
          Watchers:
          0 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 - 2 hours, 20 minutes
            2h 20m