| Newsgroups |
gmane.comp.java.orm.simpleorm |
| Message-ID |
<CA+_PZMdUyo-gJ-RYUu7TYu47ETF0pMNnhrai-tjwnw0UAh3boQ@mail.gmail.com> |
--089e015382726d186505073c3cda
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Ha! There lies the rub. It is a Hibernate world, in all its glory. And
about 5% of it is actually useful.
If you find something let me know. All I have seen is rubbish. Lots of
mapping to objects using reflection, nothing useful. What is wanted is
something simple.
A project that I am working on now has some very simple code (not written
by me) that just wraps SQL, sample below. You could knock something up
yourself like that pretty quick. If you make it into a clean module please
post it to this list. But that still leaves many issues.
Or just use SimpleOrm. If you like it pull the current from SVN. But you
will need to maintain it yourself, I have no time for it. But it is simple=
.
Anthony
private PreparedStatement executeInner(String sql, String sqlcmd,
Object... params) throws SQLException {
long start =3D System.currentTimeMillis();
boolean ok =3D false;
count =3D -1;
PreparedStatement stmt =3D null;
try {
stmt =3D dbconn.prepareStatement(sql);
setParams(stmt, params);
if (!stmt.execute()) { // returns false if result is count
count =3D stmt.getUpdateCount();
}
ok =3D true;
return stmt;
} finally {
if (stmt !=3D null) stmt.close
long timeTaken =3D System.currentTimeMillis() - start;
log.debug(format("sql: %08x : %s : %s : %d : %05dms : %s :
%s\n",
dbconn.hashCode(), sqlcmd, ok ? "ok" : "error", count,
timeTaken, sql, JSON.stringify(params)));
}
}
On Fri, Nov 7, 2014 at 11:41 AM, John Abraham [email protected] [SimpleORM]
<[email protected]> wrote:
>
>
> (But SimpleOrm has minimal support these days.)
>
>
> Any recommendations for alternatives? I refuse to use Hibernate...
>
> --
> John Abraham
>
> Sent from my iPhone, please excuse any typos.
>
> On Nov 6, 2014, at 5:25 PM, anthony berglas [email protected]
> [SimpleORM] <[email protected]> wrote:
>
>
>
> Should be OK. There is no global state.
>
> (But SimpleOrm has minimal support these days.)
>
> Anthony
>
> On Thu, Nov 6, 2014 at 10:31 PM, [email protected] [SimpleORM] <
> [email protected]> wrote:
>
>>
>>
>> Hi
>>
>>
>> Is it a problem for SimpleORM to have one java thread talking to MySql
>> and MSSQL at the same time?
>>
>>
>> thanks
>>
>> GA
>>
>>
>
>
> --
>
> Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
> Just because it is possible to push twigs along the ground with ones nose
> does not necessarily mean that that is the best way to collect firewood.
>
>=20=20=20
>
--=20
Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that that is the best way to collect firewood.
--089e015382726d186505073c3cda
Content-Type: text/html; charset=UTF-8
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>
<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif">Ha!=C2=A0 There lies the rub.=C2=A0 It is a Hibernate world, in=
all its glory.=C2=A0 And about 5% of it is actually useful.</div><div clas=
s=3D"gmail_default" style=3D"font-family:verdana,sans-serif"><br></div><div=
class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">If you fi=
nd something let me know.=C2=A0 All I have seen is rubbish.=C2=A0 Lots of m=
apping to objects using reflection, nothing useful.=C2=A0 What is wanted is=
something simple.</div><div class=3D"gmail_default" style=3D"font-family:v=
erdana,sans-serif"><br></div><div class=3D"gmail_default" style=3D"font-fam=
ily:verdana,sans-serif">A project that I am working on now has some very si=
mple code (not written by me) that just wraps SQL, sample below.=C2=A0 You =
could knock something up yourself like that pretty quick.=C2=A0 If you make=
it into a clean module please post it to this list.=C2=A0 But that still l=
eaves many issues.</div><div class=3D"gmail_default" style=3D"font-family:v=
erdana,sans-serif"><br></div><div class=3D"gmail_default" style=3D"font-fam=
ily:verdana,sans-serif">Or just use SimpleOrm.=C2=A0 If you like it pull th=
e current from SVN.=C2=A0 But you will need to maintain it yourself, I have=
no time for it.=C2=A0 But it is simple.</div><div class=3D"gmail_default" =
style=3D"font-family:verdana,sans-serif"><br></div><div class=3D"gmail_defa=
ult" style=3D"font-family:verdana,sans-serif">Anthony</div><div class=3D"gm=
ail_default" style=3D"font-family:verdana,sans-serif"><br></div><div class=
=3D"gmail_default" style><div class=3D"gmail_default" style><font face=3D"v=
erdana, sans-serif">=C2=A0 =C2=A0 private PreparedStatement executeInner(St=
ring sql, String sqlcmd, Object... params) throws SQLException {</font></di=
v><div class=3D"gmail_default" style><font face=3D"verdana, sans-serif">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 long start =3D System.currentTimeMillis();</font><=
/div><div class=3D"gmail_default" style><font face=3D"verdana, sans-serif">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 boolean ok =3D false;</font></div><div class=3D=
"gmail_default" style><font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 count =3D -1;</font></div><div class=3D"gmail_default" style><fo=
nt face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 PreparedStateme=
nt stmt =3D null;</font></div><div class=3D"gmail_default" style><font face=
=3D"verdana, sans-serif"><br></font></div><div class=3D"gmail_default" styl=
e><font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 try {</fon=
t></div><div class=3D"gmail_default" style><font face=3D"verdana, sans-seri=
f">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stmt =3D dbconn.prepareStateme=
nt(sql);</font></div><div class=3D"gmail_default" style><font face=3D"verda=
na, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 setParams(stmt, p=
arams);</font></div><div class=3D"gmail_default" style><font face=3D"verdan=
a, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!stmt.execute(=
)) { // returns false if result is count</font></div><div class=3D"gmail_de=
fault" style><font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 count =3D stmt.getUpdateCount();</font></div><=
div class=3D"gmail_default" style><font face=3D"verdana, sans-serif">=C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</font></div><div class=3D"gmail_defau=
lt" style><font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ok =3D true;</font></div><div class=3D"gmail_default" style><=
font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
return stmt;</font></div><div class=3D"gmail_default" style><font face=3D"=
verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 } finally {</font></div><d=
iv class=3D"gmail_default" style><font face=3D"verdana, sans-serif">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (stmt !=3D null) stmt.close</font></d=
iv><div class=3D"gmail_default" style><font face=3D"verdana, sans-serif">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 long timeTaken =3D System.current=
TimeMillis() - start;</font></div><div class=3D"gmail_default" style><font =
face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 log.=
debug(format("sql: %08x : %s : %s : %d : %05dms : %s : %s\n",</fo=
nt></div><div class=3D"gmail_default" style><font face=3D"verdana, sans-ser=
if">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 d=
bconn.hashCode(), sqlcmd, ok ? "ok" : "error", count,</=
font></div><div class=3D"gmail_default" style><font face=3D"verdana, sans-s=
erif">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
timeTaken, sql, JSON.stringify(params)));</font></div><div class=3D"gmail_=
default" style><font face=3D"verdana, sans-serif">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 }</font></div><div class=3D"gmail_default" style><font face=3D"verdana,=
sans-serif">=C2=A0 =C2=A0 }</font></div><div style=3D"font-family:verdana,=
sans-serif"><br></div></div></div><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Fri, Nov 7, 2014 at 11:41 AM, John Abraham <a href=3D"m=
ailto:[email protected]">[email protected]</a> [SimpleORM] <span dir=3D"ltr=
"><<a href=3D"mailto:[email protected]" target=3D"_blank">Simple=
[email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
>
<u></u>
=20
<div style=3D"background-color:#fff">
<span>=C2=A0</span>
<div>
<div>
<div>
=20=20=20=20=20=20
=20=20=20=20=20=20
<p></p><div><span class=3D""><blockquote type=3D"cite"><div><div><div=
><div dir=3D"ltr"><div class=3D"gmail_default"><font color=3D"#000000"><spa=
n>(But SimpleOrm has minimal support these days.)</span></font></div></div>=
</div></div></div></blockquote><div><br></div></span>Any recommendations fo=
r alternatives?=C2=A0 I refuse to use Hibernate...<br><br><div>--</div><div=
>John Abraham</div><div><br></div>Sent from my iPhone, please excuse any ty=
pos.=C2=A0</div><span class=3D""><div><br>On Nov 6, 2014, at 5:25 PM, antho=
ny berglas <a href=3D"mailto:[email protected]" target=3D"_blank">anthony=
@berglas.org</a> [SimpleORM] <<a href=3D"mailto:[email protected]=
m" target=3D"_blank">[email protected]</a>> wrote:<br><br></div>=
</span><blockquote type=3D"cite"><div>
=20
<span>=C2=A0</span>
<div><span class=3D"">
=20=20=20=20=20=20
=20=20=20=20=20=20
<p></p><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-fa=
mily:verdana,sans-serif">Should be OK.=C2=A0 There is no global state.</div=
><div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif"><br>=
</div><div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif"=
>(But SimpleOrm has minimal support these days.)</div><div class=3D"gmail_d=
efault" style=3D"font-family:verdana,sans-serif"><br></div><div class=3D"gm=
ail_default" style=3D"font-family:verdana,sans-serif">Anthony</div></div></=
span><div class=3D"gmail_extra"><span class=3D""><br><div class=3D"gmail_qu=
ote">On Thu, Nov 6, 2014 at 10:31 PM, <a href=3D"mailto:gershonadams@hotmai=
l.com" target=3D"_blank">[email protected]</a> [SimpleORM] <span dir=
=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>></span> wrote:<br><blockquote class=3D"gm=
ail_quote" style=3D"border-left:1px #ccc solid">
<u></u>
=20
<div style=3D"background-color:#fff">
<span>=C2=A0</span>
<div>
<div>
<div>
=20=20=20=20=20=20
=20=20=20=20=20=20
<p></p><p>Hi</p><p><br></p><p>Is it a problem for SimpleORM to have o=
ne java thread talking to MySql and MSSQL at the same time?</p><p><br></p><=
p>thanks</p><p>GA</p><p></p>
</div>
=20=20=20=20=20
=20=20=20=20
<div style=3D"color:#fff;min-height:0"></div>
</div>
=20=20
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div></span>=
<span class=3D"">-- <br><div><p>
</p><p>Dr Anthony Berglas, <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Mobile=
: +61 4 4838 8874<br>
Just because it is possible to push twigs along the ground with ones nose<b=
r>
does not necessarily mean that that is the best way to collect firewood.</p=
></div>
</span></div>
<p></p>
</div>
=20=20=20=20=20
=20=20=20=20
</div></blockquote><p></p>
</div>
=20=20=20=20=20
=20=20=20=20
<div style=3D"color:#fff;min-height:0"></div>
</div>
=20=20
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><p>
</p><p>Dr Anthony Berglas, <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Mobile=
: +61 4 4838 8874<br>
Just because it is possible to push twigs along the ground with ones nose<b=
r>
does not necessarily mean that that is the best way to collect firewood.</p=
></div>
</div>
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>
=20=20=20=20=20=20
=20=20
=20=20=20=20
<div id=3D"fromDMARC" style=3D"clear:both; margin-top: 10px;">
<hr style=3D"height:2px ; border-width:0; color:#E3E3E3; backgroun=
d-color:#E3E3E3;">
Posted by: anthony berglas <[email protected]> <hr=
style=3D"height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E=
3E3;">
</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=3D2098/stime=3D1415330179" width=3D"1" height=3D"1"> <=
br>
<!-- |**|end egp html banner|**| -->
=20=20
<!-- |**|begin egp html banner|**| -->
<br>
=20=20=20
=20=20=20=20=20
=20
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-fam=
ily: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tr=
ansform: uppercase; "><a href=3D"https://groups.yahoo.com/neo/groups/Simple=
ORM/info;_ylc=3DX3oDMTJldHVjdHRsBF9TAzk3MzU5NzE0BGdycElkAzczNjAyMjYEZ3Jwc3B=
JZAMxNzA1MDA2OTA1BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTQxNTMzMDE3OQ--" style=3D=
"text-decoration: none;">Visit Your Group</a></span>
<ul style=3D"list-style-type: none; margin: 0; padding: 0; display: in=
line;">
</ul>
</div>
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
<a href=3D"https://groups.yahoo.com/neo;_ylc=3DX3oDMTJkY285YW8yBF9TAzk3ND=
c2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlYwNmdHIEc2xrA2dmcARzd=
GltZQMxNDE1MzMwMTc5" style=3D"float: left;"><img src=3D"http://l.yimg.com/r=
u/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height=3D"15"=
width=3D"137" alt=3D"Yahoo! Groups" style=3D"border: 0;"/></a>
<div style=3D"color: #747575; float: right;"> • <a href=3D"https://i=
nfo.yahoo.com/privacy/us/yahoo/groups/details.html" style=3D"text-decoratio=
n: none;">Privacy</a> • <a href=3D"mailto:SimpleORM-unsubscribe@yahoog=
roups.com?subject=3DUnsubscribe" style=3D"text-decoration: none;">Unsubscri=
be</a> • <a href=3D"https://info.yahoo.com/legal/us/yahoo/utos/terms/"=
style=3D"text-decoration: none;">Terms of Use</a> </div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
=20=20=20
<br>
<!-- |**|end egp html banner|**| -->
<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</body>
</html>
--089e015382726d186505073c3cda--