[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Reading a blob results in updating it to database

tomerbd2 do-not-reply at jboss.com
Thu Nov 16 02:31:01 EST 2006


Hi

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()

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

Thanks

Tomer

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986397#3986397

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986397



More information about the jboss-user mailing list