Bugs item #864871, was opened at 2003-12-23 10:00
Message generated for change (Comment added) made by widerlund
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=864871&group_id=22866
Category: JBossCMP
Group: v3.2
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Christopher G. Stach II (cstach)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: CMP evals java.sql.Date and java.sql.Timestamp as dirty
Initial Comment:
JBoss 3.2.2 (all)
Sun JVM 1.4.2_02
MySQL 4.1.1
Entity bean fields are java.sql.Date (dob) and
java.sql.Timestamp (registration_time). Their values
aren't modified, yet they are considered dirty and updated.
031223 3:35:32 4825 Query SELECT id FROM
table WHERE id=2
4825 Query SELECT
field1, registration_time, dob, fieldn FROM table WHERE
(id=2)
4825 Query UPDATE
table SET registration_time='2003-11-17 00:48:50',
dob='1971-01-29' WHERE id=2
[...]
4825 Query commit
----------------------------------------------------------------------
Comment By: Widerlund (widerlund)
Date: 2004-03-02 11:27
Message:
Logged In: YES
user_id=988600
The fix in Branch_3_2 does not seem to cover the
case with a field of type java.sql.Time.
----------------------------------------------------------------------
Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-12-23 17:35
Message:
Logged In: YES
user_id=543482
Fixed in Branch_3_2 (currently 3.2.4RC1) and HEAD.
The date types were treated as usual mutable types and used
JDBCTypeFactory.INVALID_UNLESS_NULL state factory. Now date
types rely on equals() for dirty checking, i.e.
JDBCTypeFactory.EQUALS.
To workaround this bug you could write provide a
CMPFieldStateFactory implementation that relies on equals():
<cmp-field>
<field-name>utilDate</field-name>
<state-factory>com.myapp.EqualsStateFactory</state-factory>
</cmp-field>
Or, if you update the fields only with setters:
<cmp-field>
<field-name>sqlDate</field-name>
<check-dirty-after-get>false</check-dirty-after-get>
</cmp-field>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=864871&group_id=22866
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development