ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Lazy Loading losing field value
Date Tue, 04 Sep 2007 22:41:04 GMT

<br><font size=2 face="sans-serif">I'm using iBatis 2.3.0 build# 677 with
JDK 1.5.11</font>
<br>
<br><font size=2 face="sans-serif">I have the following 3 tables.</font>
<br>
<br><font size=2 color=#820040 face="Courier New"><b>create</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>table</b></font><font
size=2 face="Courier New">
op_rule_drl (</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;id &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#4100c2 face="Courier New"><b>numeric</b></font><font size=2
face="Courier New">(18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;identity,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;name &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040
face="Courier New"><b>varchar</b></font><font size=2 face="Courier
New">(32)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;content &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font
size=2 color=#4100c2 face="Courier New"><b>null</b></font><font size=2
face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;create_date &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp;datetime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040
face="Courier New"><b>default</b></font><font size=2 face="Courier
New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;mod_date &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; datetime &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#820040 face="Courier New"><b>default</b></font><font size=2
face="Courier New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;version &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=2 color=#4100c2
face="Courier New"><b>int</b></font><font size=2 face="Courier New">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;</font><font size=2 color=#820040 face="Courier New"><b>default</b></font><font
size=2 face="Courier New">
0 </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font>
<br><font size=2 face="Courier New">)</font>
<br><font size=2 face="Courier New">lock datarows</font>
<br><font size=2 color=#820040 face="Courier New"><b>with</b></font><font
size=2 face="Courier New">
identity_gap = 10</font>
<br><font size=2 face="Courier New">go</font>
<br>
<br><font size=2 color=#820040 face="Courier New"><b>create</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>table</b></font><font
size=2 face="Courier New">
op_rule_dsl (</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;id &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#4100c2 face="Courier New"><b>numeric</b></font><font size=2
face="Courier New">(18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;identity,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;name &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040
face="Courier New"><b>varchar</b></font><font size=2 face="Courier
New">(32)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;content &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font
size=2 color=#4100c2 face="Courier New"><b>null</b></font><font size=2
face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;create_date &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp;datetime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040
face="Courier New"><b>default</b></font><font size=2 face="Courier
New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;mod_date &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; datetime &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#820040 face="Courier New"><b>default</b></font><font size=2
face="Courier New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;version &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=2 color=#4100c2
face="Courier New"><b>int</b></font><font size=2 face="Courier New">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;</font><font size=2 color=#820040 face="Courier New"><b>default</b></font><font
size=2 face="Courier New">
0 </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font>
<br><font size=2 face="Courier New">)</font>
<br><font size=2 face="Courier New">lock datarows</font>
<br><font size=2 color=#820040 face="Courier New"><b>with</b></font><font
size=2 face="Courier New">
identity_gap = 10</font>
<br><font size=2 face="Courier New">go</font>
<br>
<br><font size=2 color=#820040 face="Courier New"><b>create</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>table</b></font><font
size=2 face="Courier New">
op_rule_set (</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;id &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#820040 face="Courier New"><b>varchar</b></font><font size=2
face="Courier New">(32)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;drl_id &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#4100c2 face="Courier
New"><b>numeric</b></font><font size=2 face="Courier New">(18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;dsl_id &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#4100c2 face="Courier
New"><b>numeric</b></font><font size=2 face="Courier New">(18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;description &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp;</font><font size=2 color=#820040 face="Courier New"><b>varchar</b></font><font
size=2 face="Courier New">(200)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;create_date &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp;datetime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040
face="Courier New"><b>default</b></font><font size=2 face="Courier
New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;mod_date &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; datetime &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2
color=#820040 face="Courier New"><b>default</b></font><font size=2
face="Courier New">
getdate() </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font><font
size=2 face="Courier New">,</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;version &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=2 color=#4100c2
face="Courier New"><b>int</b></font><font size=2 face="Courier New">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;</font><font size=2 color=#820040 face="Courier New"><b>default</b></font><font
size=2 face="Courier New">
0 </font><font size=2 color=#820040 face="Courier New"><b>not</b></font><font
size=2 face="Courier New">
</font><font size=2 color=#4100c2 face="Courier New"><b>null</b></font>
<br><font size=2 face="Courier New">)</font>
<br><font size=2 face="Courier New">lock datarows</font>
<br><font size=2 color=#820040 face="Courier New"><b>with</b></font><font
size=2 face="Courier New">
identity_gap = 10</font>
<br><font size=2 face="Courier New">go</font>
<br>
<br>
<br><font size=2 face="sans-serif">I have corresponding Domain &amp; Doa
objects. Everything works well when I perform operations on the RuleDSL
and RuleDRL. (select, insert, update, delete) </font>
<br>
<br><font size=2 face="sans-serif">The problem is when I lazy load these
objects from my RuleSet SQLMap. The objects get loaded except one field.
As detailed above, the version field is for optimistic locking. When I
load them lazily from the RuleSet object all values are returned correctly
but the version field is null in both the RuleDSL and RuleDRL objects.
This of course prevents me from performing any update or delete operations
on the objects. I don't understand why this should be occurring as I have
verified the operations in both the RuleDRL and RuleDSL maps work correctly.
When I perform a findByPrimaryKey in both of these SQL Maps all values
are returned as expected. Only when these objects are loaded lazily do
I see this issue. I've attached the SQL maps incase I have overlooked something.</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the help...</font>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Chris Mathrusse<br>
christopher.mathrusse@sybase.com<br>
Sybase, Inc<br>
One Sybase Drive<br>
Dublin, CA 94568<br>
(925) 236-5553</font>
Mime
View raw message