6 Replies Latest reply on Aug 30, 2004 3:00 PM by ceh

    BLOBs and Transactions

    ceh

      Hi,
      JBoss 3.2.4
      Oracle 9 or 10
      I have a bean with byte[] fields that are stored as BLOBs in the Oracle database. The bean is created with the blobs empty. When I update both blob fields (an image and an audio clip) within a transaction using the setter method, the values get switched in the database. That is, the audio clip ends up in the image field and vice versa. If I do the exact same update, but not within an explicit transaction, the values get entered in the database correctly and can be nicely retreived, etc. I cannot find anything anywhere that speaks to this issue - I appreciate any help.

        • 1. Re: BLOBs and Transactions
          sbrbot

          It seems that we're talkink about typo! Look at your column indicies of prepared statement (AFAIK the PreparedStatement is the only way for inserting BLOB/CLOB fields).

          • 2. Re: BLOBs and Transactions
            ceh

            I am not using PreparedStatement. I am using the setter, i.e. myobj.setGraphic(g) and myobj.setAudio(a) where g and a are byte[]. Please keep in mind, this works just fine outside of an explicit transaction. If there were a typo, this would not be true.

            • 3. Re: BLOBs and Transactions
              sbrbot

              Then something wierd is happenong there, sounds like a bug but send something more ...

              • 4. Re: BLOBs and Transactions
                ceh

                Yes, it seems very wierd to me and feels like it could be a bug. I was hoping to find someone here who knew more about this than I. It does not seem I am doing something that out of the ordinary - updating 2 BLOBs at once. What additional information would help? There are no errors being generated, so no trace stack to send. Not sure where to go from here.

                • 5. Re: BLOBs and Transactions
                  ceh

                  Additional information as my testing continues: if I update the blobs directly using PreparedStatement, SQL, etc. the problem does not manifest. From this I conclude that my JDBC drivers and DB (Oracle) are not the culprit but that it is a bug in JBoss.

                  • 6. Re: BLOBs and Transactions
                    ceh

                    Turns out this is an Oracle JDBC bug, found in 10.0.1.