thanks for the response. i checked again and i'm using BMP (attached is ejb-jar.xml). i haven't really got my head around how transactions work with entity beans although doing lots of reading at the moment. i'm thinking maybe the orion ejb container is treating each of my entity bean calls as a transaction (as supported by profiling the sql server database we're using), and that's why store is being called (?). we currently use stateless server beans, and handle connection pooling ourselves since all the ejb connection pooling stuff asn't that mature when we started our project. we're now relooking at entity beans, etc, and working out how to do all the simple things like controlling transaction boundaries, etc, and connection pooling. greg. ----- Original Message ----- From: "James Ho" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, October 19, 2000 6:04 AM Subject: Re: findByPrimaryKey() calling store() > Hi Greg... > > According to Orion1.4.0's changes.txt it said: > > Optimized CMP entity stores to only store updated fields. > > > I am not 100% sure what it means though..maybe it is what u are after... > > James. > > > > Greg Matthews wrote: > > > > 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 > >
<?xml version="1.0" encoding="Cp1252"?> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'> <ejb-jar> <enterprise-beans> <entity> <ejb-name>OrderBean</ejb-name> <home>com.sales.OrderHome</home> <remote>com.sales.Order</remote> <ejb-class>com.sales.OrderBean</ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>java.lang.Integer</prim-key-class> <reentrant>False</reentrant> <resource-ref> <description> reference to a jdbc datasource mentioned down in the DD section </description> <res-ref-name>jdbc/orderDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </entity> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>OrderBean</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar>
