0 Replies Latest reply on Nov 16, 2006 2:30 AM by tomerbd2

    Reading a blob results in updating it to database

    tomerbd2 Newbie


      I have an entity bean:

      TestBLOB with fields: id, object, someString
      object is stored to database as a blob.

      When i findByPrimaryKey(id) the entity bean and do getObject() then at the end of the transaction the TestBLOB is being written to database (enabled my cmp logging). If i do the same but do not read getObject() but read getSomeString() then at the end of the transaction the object is not written back to database.

      My problem is that when the data is written back to database then the next time i read the entity bean its not being taken from cache but a SELECT statement is being issued.

      Why is the TestBLOB being written to database at the end of the transaction if i do getObject()?
      How can i make sure that my TestBLOB will be taken from cache although i do getObject()

      I'm using commit option A and i have a read only on all my get* methods.