Bugs item #864871, was opened at 2003-12-23 11:00
Message generated for change (Comment added) made by loubyansky
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: Alexey Loubyansky (loubyansky)
Date: 2003-12-23 18: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


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to