[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hsqldb-user
Subject:    Re: [Hsqldb-user] Generated IDs Issue?
From:       "Fred Toussi" <fredt () users ! sourceforge ! net>
Date:       2011-11-05 0:17:18
Message-ID: 1320452238.14842.140660994865781 () webmail ! messagingengine ! com
[Download RAW message or body]

This is a multi-part message in MIME format.

--_----------=_1320452238148420
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
Date: Fri, 4 Nov 2011 20:17:18 -0400
X-Mailer: MessagingEngine.com Webmail Interface

The source is in the Subversion repository (see out SourceForge
project page). You need to checkout revision 4666 of /base/trunk
directory to match the snapshot jar.

Fred

On Friday, November 04, 2011 7:35 PM, "Mike Ressler"
<mressler@gmail.com> wrote:

  I grabbed the 2.2.6 jar, is there a src dir for 2.2.6
  somewhere for me to pull down?
  Thanks as always, Fred!


  _________________________________________________________

  On Nov 4, 2011 6:30 PM, Fred Toussi
  <fredt@users.sourceforge.net> wrote:

It would be better to aim for 2.2.6 as we can fix any issues
before release. The snapshot jar has the debug information.
Please try to find out whether Hibernate is using IDENITY() or
the JDBC support. You can intercept the first one in
org.hsqldb.FunctionCustom and the second one in
org.hsqldb.StatementDML#getGeneratedColumnInfo to see the value
returned and used.

Fred


On Friday, November 04, 2011 9:37 PM, "Mike Ressler"
<mressler@gmail.com> wrote:

  HSQLDBers,



I'm planning on upgrading from HSQLDB 2.0.0 to 2.2.5 and I'm
seeing some perplexing results.  I'm using Hibernate with HSQLDB
and the Hibernate layer is giving me errors such as:



org.hibernate.NonUniqueObjectException: a different object with
the same identifier value was already associated with the
session: [com.ressq.stateasy.model.GameStateProperty#0]



Turns out I'm seeing this because Hibernate is correctly saving a
few objects but on all insert statements for this table, it's
detecting that the generated ID for the INSERT statement is 0.
This is confusing Hibernate and giving me the error I'm seeing.
I'm pretty sure it's HSQLDB related since the same test works
with the 2.0.0 HSQLDB jar, just fails with 2.2.5 and the 2.2.6
RC.



Other things that my psychic debugging intuition tells me may be
relevant: this table has a generated column that on insert would
have been set to NULL, but might be throwing off the code that
reports the generated ID?  Just a stab, but thought I'd mention
it.  Here's the column definition.



CREATE MEMORY TABLE PUBLIC.GAMESTATEPROPERTIES(GAMESTATEPROPERTY
INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 256) NOT NULL
PRIMARY KEY,PROPERTYNAME VARCHAR(255) NOT NULL,PROPERTYVALUE
VARCHAR(255) NOT NULL,PROPERTYVALUENUM INTEGER GENERATED ALWAYS
AS( CASEWHEN(REGEXP_MATCHES(TRIM(BOTH ' ' FROM
PUBLIC.GAMESTATEPROPERTIES.PROPERTYVALUE),'[0-9]+'),
CAST(TRIM(BOTH ' ' FROM PUBLIC.GAMESTATEPROPERTIES.PROPERTYVALUE)
AS INTEGER),NULL)),UNIQUE(PROPERTYNAME,PROPERTYVALUE))



Any help is appreciated!  I'm still poking at this bug to figure
out exactly where it's coming from.  The 2.2.5 jar isn't built
with line numbers, so it's going to be tough for me to track it
down.  Is there a version out there with debug symbols?



Mike Ressler

--------------------------------------------------------------------------
----
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1

_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user



--------------------------------------------------------------------------
----
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1

_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user

--_----------=_1320452238148420
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/html; charset="us-ascii"
Date: Fri, 4 Nov 2011 20:17:18 -0400
X-Mailer: MessagingEngine.com Webmail Interface

<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" \
"http://www.w3.org/TR/html4/loose.dtd"/*EC*/--> <html><head><title></title><style \
type="text/css"><!-- \
body{padding:1ex;margin:0;font-family:sans-serif;font-size:small}a[href]{color:-moz-hy \
perlinktext!important;text-decoration:-moz-anchor-decoration}blockquote{margin:0;border-left:2px \
solid #144fae;padding-left:1em}blockquote blockquote{border-color:#006312}blockquote \
blockquote blockquote{border-color:#540000} --></style></head><body><div \
style="font-family: Arial; font-size: medium;" dir="ltr"><div>  <div>
		The source is in the Subversion repository (see out SourceForge project page). You \
need to checkout revision 4666 of /base/trunk directory to match the snapshot \
jar.</div>  <div>
		&nbsp;</div>
	<div>
		Fred</div>
	<div>
		&nbsp;</div>
</div>
<div class="defangedMessage">
	<div id="me56905">
		<div>
			On Friday, November 04, 2011 7:35 PM, &quot;Mike Ressler&quot; \
&lt;mressler@gmail.com&gt; wrote:</div>  <blockquote class="me56905QuoteMessage" \
type="cite">  I grabbed the 2.2.6 jar, is there a src dir for 2.2.6 somewhere for me \
to pull down?<br />  <br />
			<span style="font-family:Prelude, Verdana, san-serif;">Thanks as always, \
Fred!</span><br />  <br />
			<div id="me56905no_signature" style="overflow:hidden;">
				&nbsp;</div>
			<hr align="left" style="width:75%" />
			<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">On Nov 4, 2011 \
6:30 PM, Fred Toussi &lt;fredt@users.sourceforge.net&gt; wrote: </span><br />  <br />
			<div dir="ltr" style="font-family: Arial; font-size: medium;">
				<div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">It would be \
better to aim for 2.2.6 as we can fix any issues before release. The snapshot jar has \
the debug information. Please try to find out whether Hibernate is using IDENITY() or \
the JDBC support. You can intercept the first one in org.hsqldb.FunctionCustom and \
the second one in org.hsqldb.StatementDML#getGeneratedColumnInfo to see the value \
returned and used.</span></div>  <div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">Fred</span></div>  <div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div class="me56905defangedMessage">
					<div id="me56905me19652">
						<div>
							<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">On Friday, \
November 04, 2011 9:37 PM, &quot;Mike Ressler&quot; &lt;mressler@gmail.com&gt; \
wrote:</span></div>  <blockquote class="me56905me19652QuoteMessage" type="cite">
							<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">HSQLDBers, \
</span>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">I&#39;m \
planning on upgrading from HSQLDB 2.0.0 to 2.2.5 and I&#39;m seeing some perplexing \
results. &nbsp;I&#39;m using Hibernate with HSQLDB and the Hibernate layer is giving \
me errors such as:</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; "><span \
style="">org.hibernate.NonUniqueObjectException: a different object with the same \
identifier value was already associated with the session: \
[com.ressq.stateasy.model.GameStateProperty#0]</span></span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">Turns out \
I&#39;m seeing this because Hibernate is correctly saving a few objects but on all \
insert statements for this table, it&#39;s detecting&nbsp;that the generated ID for \
the INSERT statement is 0. &nbsp;This is confusing Hibernate and giving me the error \
I&#39;m seeing. &nbsp;I&#39;m pretty sure it&#39;s HSQLDB related since the same test \
works with the 2.0.0 HSQLDB jar,&nbsp;just fails with 2.2.5 and the 2.2.6 \
RC.</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">Other \
things that my psychic debugging intuition tells me may be relevant: this table has a \
generated column that on insert would have been set to NULL, but might be throwing \
off the code that reports the generated ID? &nbsp;Just a stab, but thought I&#39;d \
mention it. &nbsp;Here&#39;s the column definition.</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; "><span \
style="">CREATE MEMORY TABLE PUBLIC.GAMESTATEPROPERTIES(GAMESTATEPROPERTY INTEGER \
GENERATED BY DEFAULT AS IDENTITY(START WITH 256) NOT NULL PRIMARY KEY,PROPERTYNAME \
VARCHAR(255) NOT NULL,PROPERTYVALUE VARCHAR(255) NOT NULL,PROPERTYVALUENUM INTEGER \
GENERATED ALWAYS AS( CASEWHEN(REGEXP_MATCHES(TRIM(BOTH &#39; &#39; FROM \
PUBLIC.GAMESTATEPROPERTIES.PROPERTYVALUE),&#39;[0-9]+&#39;), CAST(TRIM(BOTH &#39; \
&#39; FROM PUBLIC.GAMESTATEPROPERTIES.PROPERTYVALUE) AS \
INTEGER),NULL)),UNIQUE(PROPERTYNAME,PROPERTYVALUE))</span></span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">Any help \
is appreciated! &nbsp;I&#39;m still poking at this bug to figure out exactly where \
it&#39;s coming from. &nbsp;The 2.2.5 jar isn&#39;t built with line numbers, so \
it&#39;s going to be tough for me to track it down. &nbsp;Is there a version out \
there with debug symbols?</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  <div>
								<span style="color:navy; font-family:Prelude, Verdana, san-serif; ">Mike \
Ressler</span></div>  <pre>
<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">------------------------------------------------------------------------------ \
RSA(R) Conference 2012 Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
</span></pre>
							<pre>
<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">_______________________________________________ Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user

</span></pre>
						</blockquote>
					</div>
				</div>
				<div>
					<span style="color:navy; font-family:Prelude, Verdana, san-serif; \
">&nbsp;</span></div>  </div>
			<pre>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
</pre>
			<pre>
_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user

</pre>
		</blockquote>
	</div>
</div>
<div>
	&nbsp;</div>
</div></body></html>
--_----------=_1320452238148420--



------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1

_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic