About the usage of SUNQUERIED
Jacques Klein <[email protected]> Wed, 26 Oct 2011 12:09:42 +0200
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <CAHD=-kW93SK3JMWofB13GUE4fGE9i1A6qUmD-MRXTe1TZGa7hA@mail.gmail.com> |
--0016364164dbca4b5404b030daa3
Content-Type: text/plain; charset=ISO-8859-1
I want a simple SQL table with two rows, so I do:
SFieldString name = new SFieldString(TABLE, "NAME", 10,
SPRIMARY_KEY);
SFieldString data = new SFieldString(TABLE, "DATA", 1000,
SUNQUERIED);
Table creation is ok.
Than I create an element using SDataLoader::
myDL.insertRecords(new Object[][] { { "n1" } });
I can only give the NAME otherwise I get a
simpleorm.utils.SException$Error: 1 columns required in parameter
array.
Now I set the DATA with:
elm = ses.find(SimpleTable.TABLE, "n1");
elm.setString(DATA, "data1");
and:
ses.commit();
Problem, I have following error (and there is no concurrency):
simpleorm.dataset.SRecordInstance$BrokenOptimisticLockException:
Broken Optimistic Lock [SimpleTable n1 Dirty0]
If I use SDESCRIPTIVE instead SUNQUERIED for DATA, it's ok, but DATA will be
a "Big String" and I don't want to "load" it when "SELECTing" or "UPDATing"
(hence the SUNQUERIED)
Tried this with version 3.11 and also with svn.
Any help welcome, Jacques Klein
--0016364164dbca4b5404b030daa3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<head>
<style type=3D"text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title=20
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;=20
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html>
<head>
<style type=3D"text/css">
<!--
#ygrp-mkp {
border: 1px solid #d8d8d8;
font-family: Arial;
margin: 10px 0;
padding: 0 10px;
}
#ygrp-mkp hr {
border: 1px solid #d8d8d8;
}
#ygrp-mkp #hd {
color: #628c2a;
font-size: 85%;
font-weight: 700;
line-height: 122%;
margin: 10px 0;
}
#ygrp-mkp #ads {
margin-bottom: 10px;
}
#ygrp-mkp .ad {
padding: 0 0;
}
#ygrp-mkp .ad p {
margin: 0;
}
#ygrp-mkp .ad a {
color: #0000ff;
text-decoration: none;
}
-->
</style>
</head>
<body>
I want a simple SQL table with two rows, so I do:<br>=A0=A0=A0=A0=A0=A0 SFi=
eldString name =3D new SFieldString(TABLE, "NAME", 10, SPRIMARY_K=
EY);<br>=A0=A0=A0=A0=A0=A0 SFieldString data =3D new SFieldString(TABLE, &q=
uot;DATA", 1000, SUNQUERIED);<br>
Table creation is ok.<br><br>Than I create an element using SDataLoader::<b=
r>=A0=A0=A0=A0=A0=A0 myDL.insertRecords(new Object[][] { { "n1" }=
});<br>I can only give the NAME otherwise I get a <br>=A0=A0=A0=A0=A0=A0 s=
impleorm.utils.SException$Error: 1 columns required in parameter array.<br>
<br>Now I set the DATA with:<br>=A0=A0=A0=A0=A0=A0 elm =3D ses.find(SimpleT=
able.TABLE, "n1");<br>=A0=A0=A0=A0=A0=A0 elm.setString(DATA, &quo=
t;data1");<br>and:<br>=A0=A0=A0=A0=A0=A0 ses.commit();<br><br>Problem,=
I have following error (and there is no concurrency):<br>
=A0=A0=A0=A0=A0 simpleorm.dataset.SRecordInstance$BrokenOptimisticLockExcep=
tion: Broken Optimistic Lock [SimpleTable n1 Dirty0]<br><br>If I use SDESCR=
IPTIVE instead SUNQUERIED for DATA, it's ok, but DATA will be a "B=
ig String" and I don't want to "load" it when "SELE=
CTing" or "UPDATing" (hence the SUNQUERIED)<br>
<br>Tried this with version 3.11 and also with svn.<br><br>Any help welcome=
,=A0 Jacques Klein<br><br><br><br>
<!-- |**|begin egp html banner|**| -->
<br>
=20=20=20=20
=20=20=20=20
<br>
<!-- |**|end egp html banner|**| -->
<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D7360226/grpspI=
d=3D1705006905/msgId=3D2036/stime=3D1319623785" width=3D"1" height=3D"1"> <=
br>
<!-- |**|end egp html banner|**| -->
=20=20
<!-- |**|begin egp html banner|**| -->
<br>
<div style=3D"font-family: verdana; font-size: 77%; border-top: 1px s=
olid #666; padding: 5px 0;" >
Your email settings: Individual Email|Traditional <br>
<a href=3D"http://groups.yahoo.com/group/SimpleORM/join;_ylc=3DX3oDMT=
JmZmJuZm5jBF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlY=
wNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzMTk2MjM3ODU-">Change settings via the Web</a=
> (Yahoo! ID required) <br>
Change settings via email: <a href=3D"mailto:SimpleORM-digest@yahoogr=
oups.com?subject=3DEmail Delivery: Digest">Switch delivery to Daily Digest<=
/a> | <a href =3D "mailto:[email protected]?subject=3D=
Change Delivery Format: Fully Featured">Switch to Fully Featured</a> <br>
<a href=3D"http://groups.yahoo.com/group/SimpleORM;_ylc=3DX3oDMT=
JkMGtyMnZmBF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlY=
wNmdHIEc2xrA2hwZgRzdGltZQMxMzE5NjIzNzg1">
Visit Your Group=20
</a> |
<a href=3D"http://docs.yahoo.com/info/terms/">
Yahoo! Groups Terms of Use
</a> |
<a href=3D"mailto:[email protected]?subject=3DUns=
ubscribe">
Unsubscribe=20
</a>=20
<br>
</div>
<br>
<!-- |**|end egp html banner|**| -->
<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</body>
</html>
--0016364164dbca4b5404b030daa3--