Bugs item #791501, was opened at 2003-08-19 23:42
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=791501&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Jerrold E Eads (jeeads)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Optimistic locking problem with SQL Server 2000

Initial Comment:
Optimistic Locking problem when using SQL Server 2000 

and JBoss 3.2.1

 

When using SQL Server with JBoss 3.2.1 the following 

problem occurs.

When updating an optimistically locked field that has an 

initial value of null the update fails.

 

Code related:

JDBCStoreCommand.java  line 00108

sql.append(" WHERE").append(SQLUtil.getWhereClause

(whereFields));

 

The where fields are the primary key field and the 

optimistically  locked fields.

 

String jdbc::SQLUtil::getWhereClause(List fields) [inline 

static]

Returns columnName0=? [AND columnName1=? [AND 

columnName2=? [....]]]

 

In SQL Server 2000 if a field is null the syntax has to be

columnName0 is ?  where ? is null

 

The columnName=? syntax fails the update.

 

The call on line 00108 should not be completed until the 

values for the lockedFields are 

known.  This could be done in the for loop between lines 

00142 and 00147.  After getting 

the values a call to SQLUtil.getWhereClause

(JDBCFieldBridge field) or

SQLUtil.getIsNullClause(boolean not, JDBCFieldBridge 

field, String identifier) could be

appended to make the SQL statement correct.



----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-10-05 15:30

Message:
Logged In: YES 
user_id=543482

Fixed in 3.2.2RC5. Thanks!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=791501&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to