Have you implemented the suggestion in the FAQ and added an isModified() method to your bean?
 
 
I am using CMP Entity beans and call many methods on it that do not modify the state of
the bean. How can I help Orion figure out that I am not changing the state and that it
does not need to talk to the database?
 
     Implement the method "public boolean isModified()" in your bean to return a boolean flag that you set each
     time you modify your bean and clear in ejbStore(). If isModified() returns false, Orion knows that it doesn't
     need to talk to the database
 
 
 -----Original Message-----
From: Greg Matthews [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 18, 2000 12:52 AM
To: Orion-Interest
Subject: findByPrimaryKey() calling store()

dear all,

i have a jsp that calls findByPrimaryKey on an entity bean.

the data that the bean represents exists in the database.

it seems like ejbStore is being called as a result of calling
findByPrimaryKey.

also, once i have a reference to the bean, calling an accessor
method on it also seems to cause ejbStore to be called.

is there something i can set to prevent the bean being
updated when there is no (apparent?) need, or am i
missing something?
 
thanks,
greg.


// as a result of findByPrimaryKey
SELECT id FROM sales_order WHERE id = 5
UPDATE sales_order SET notes = 'notes 5' WHERE id = 5
IF @@TRANCOUNT>0 COMMIT TRAN BEGIN TRAN

// as a result of calling order.getNotes( ), an EJB method
// that does not access the database
UPDATE sales_order SET notes = 'notes 5' WHERE id = 5
IF @@TRANCOUNT>0 COMMIT TRAN BEGIN TRAN

Reply via email to