Using JBoss 3.2.5, "Instance Per Transaction CMP 2.x Container", optimistic-locking, 
and modified-strategy..

I have a problem whereby the "modified" field used in the WHERE clause for the UPDATE 
seems to be wrong (includes fields which have not changed).

I've setup a little test case which gets a value object from the Company entity, 
updates the address1 field in the VO then uses the VO to update the entity.

the setCompanyValue method in the Entity looks like this :

public void setCompanyValue(CompanyValue vo) {
setYardName(vo.getYardName());
setAddress1(vo.getAddress1());
setAddress2(vo.getAddress2());
//etc
}

when I run my test I get the following in my logs :


2004-10-08 16:14:10,288 DEBUG [Company] optimistic locking: modified strategy

16:28:08,597 DEBUG [Company] Executing SQL: UPDATE company SET address1=? WHERE 
site_id=? AND yard_id=? AND yardname=? AND maincontact=? AND address1=? AND address2=? 
AND address3=? AND city=? AND state=? AND zip=? AND phone1=? AND phone2=? AND fax=? 
AND email=? AND yardurl=? AND dealernumber=? AND taxid=? AND taxname1=? AND taxrate1=? 
AND taxname2=? AND taxrate2=? AND threshold1=? AND threshold2=? AND taxrule1=? AND 
taxrule2=? AND statementlastrun=? AND statementenddate=? AND version=?


only the address1 field was updated - and of course this is included in the SET part 
of the SQL but the other fields should'nt be included in the WHERE clause,

anyone know how I can fix this ? 

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

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


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to