<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Porting [fleXive] to the H2 Database</title>
	<atom:link href="http://blog.flexive.org/2008/12/05/porting-flexive-to-the-h2-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexive.org/2008/12/05/porting-flexive-to-the-h2-database/</link>
	<description></description>
	<lastBuildDate>Mon, 31 Aug 2009 14:40:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Markus Plesser</title>
		<link>http://blog.flexive.org/2008/12/05/porting-flexive-to-the-h2-database/#comment-8</link>
		<dc:creator>Markus Plesser</dc:creator>
		<pubDate>Thu, 11 Dec 2008 08:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexive.org/?p=55#comment-8</guid>
		<description>Hi Thomas,

thanks a lot for the time and effort you put into answering and actually already fixing these issues!

Concerning &quot;id and version of a content instance as the primary key and rely on
references to the id&quot;:
I was afraid that this is the expected and correct behaviour :(
Do you have any suggestions how to reference an id where the version does not matter using some kind of foreign key constraint?
I can not reference a specific version since it may be removed but the reference is still valid as long as *any* version exists ... a bit tricky I am afraid.

&gt;&gt; Query timeouts: statement.setQueryTimeout(15/*seconds*/); is not working
&gt; 
&gt; I can&#039;t reproduce this problem. What version of H2 do you use? Maybe
&gt; an old version of H2 is in the classpath?

I use version 1.1.103 (2008-11-07) and there is only this one version in the classpath, I double checked.
If I set timeouts to 15 (seconds, I tried 15000 as well guessing it could be milliseconds) I get this exception cause:
&quot;Caused by: org.h2.jdbc.JdbcSQLException: Statement was canceled or the session timed out [90051-103]&quot;


&gt; 
&gt; &gt; Order By: ... issues if used in a subquery in the main queries where clause: the query parser just wont compile the query.
&gt; 
&gt; I can&#039;t reproduce the problem, but I remember there were problems so
&gt; time ago. How does the query look like exactly?

I&#039;m sorry I can not give you a simpler and &quot;cleaner&quot; query, but this one is generated from out parser and the offending order by is commented out:

SELECT 
filter.rownr,filter.id,filter.ver,filter.created_by ,filter.ID prop_0_0
,filter.VER prop_0_1
,filter.ID prop_1_0
,(SELECT sub.FTEXT1024 FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=101 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 ) prop_2_0
,concat(filter.xpathPref,(SELECT sub.XPATHMULT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=101 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 )) propX_2_1
,filter.prop_3_0
,concat(filter.xpathPref,(SELECT sub.XPATHMULT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=105 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 )) propX_3_1
FROM (SELECT SET(@rownr,@rownr+1) rownr, * FROM (select filter.id,filter.ver,filter.created_by,concat(concat(concat(concat(concat(t.name,&#039;[@pk=&#039;),filter.id),&#039;.&#039;),filter.ver),&#039;]&#039;) xpathPref ,(SELECT sub.FINT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=105 AND (sub.lang=1 OR sub.ismldef=true) /*ORDER BY sub.ismldef  LIMIT 1*/ ) prop_3_0
,null
FROM FXS_SEARCHCACHE_MEMORY filter, FXS_TYPEDEF t WHERE search_id=410 AND filter.tdef=t.id  AND filter.TDEF=6  ORDER BY 5 desc)) filter ORDER BY 1


&gt; 
&gt; &gt; webfrontend ... remove a database called flexive all databases that begin with the term flexive and exist in the same directory are removed as well
&gt; 
&gt; I can&#039;t reproduce this problem with the current version.

With version 1.1.103 and removing &quot;flexive&quot; and having flexiveTest and flexiveConfiguration the command line you print in the webfrontend is
java -cp h2.jar org.h2.tools.DeleteDbFiles   -dir &quot;~&quot; -db &quot;flexive&quot;

and I get this result which removes &quot;flexive&quot; and &quot;flexiveTest&quot;:

Processed: /home/mplesser/flexiveTest.lobs.db/245.t879.lob.db
Processed: /home/mplesser/flexiveTest.lobs.db/158.t879.lob.db
.....
Processed: /home/mplesser/flexiveTest.lobs.db/98.t1077.lob.db
Processed: /home/mplesser/flexive.index.db
Processed: /home/mplesser/flexive.6.log.db
Processed: /home/mplesser/flexive.data.db
Processed: /home/mplesser/flexive.lobs.db/83.t205.lob.db
...
Processed: /home/mplesser/flexive.lobs.db/120.t205.lob.db
Processed: /home/mplesser/flexive.lobs.db

Please let me know if I can further assist you in looking at these issues. 
I could help you to run and setup the flexive testcases to reproduce this easily.

Cheers and thanks,
Markus

(this is a crosspost from the H2 mailinglist)</description>
		<content:encoded><![CDATA[<p>Hi Thomas,</p>
<p>thanks a lot for the time and effort you put into answering and actually already fixing these issues!</p>
<p>Concerning &#8220;id and version of a content instance as the primary key and rely on<br />
references to the id&#8221;:<br />
I was afraid that this is the expected and correct behaviour <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Do you have any suggestions how to reference an id where the version does not matter using some kind of foreign key constraint?<br />
I can not reference a specific version since it may be removed but the reference is still valid as long as *any* version exists &#8230; a bit tricky I am afraid.</p>
<p>&gt;&gt; Query timeouts: statement.setQueryTimeout(15/*seconds*/); is not working<br />
&gt;<br />
&gt; I can&#8217;t reproduce this problem. What version of H2 do you use? Maybe<br />
&gt; an old version of H2 is in the classpath?</p>
<p>I use version 1.1.103 (2008-11-07) and there is only this one version in the classpath, I double checked.<br />
If I set timeouts to 15 (seconds, I tried 15000 as well guessing it could be milliseconds) I get this exception cause:<br />
&#8220;Caused by: org.h2.jdbc.JdbcSQLException: Statement was canceled or the session timed out [90051-103]&#8221;</p>
<p>&gt;<br />
&gt; &gt; Order By: &#8230; issues if used in a subquery in the main queries where clause: the query parser just wont compile the query.<br />
&gt;<br />
&gt; I can&#8217;t reproduce the problem, but I remember there were problems so<br />
&gt; time ago. How does the query look like exactly?</p>
<p>I&#8217;m sorry I can not give you a simpler and &#8220;cleaner&#8221; query, but this one is generated from out parser and the offending order by is commented out:</p>
<p>SELECT<br />
filter.rownr,filter.id,filter.ver,filter.created_by ,filter.ID prop_0_0<br />
,filter.VER prop_0_1<br />
,filter.ID prop_1_0<br />
,(SELECT sub.FTEXT1024 FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=101 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 ) prop_2_0<br />
,concat(filter.xpathPref,(SELECT sub.XPATHMULT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=101 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 )) propX_2_1<br />
,filter.prop_3_0<br />
,concat(filter.xpathPref,(SELECT sub.XPATHMULT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=105 AND (sub.lang=1 OR sub.ismldef=true) ORDER BY sub.ismldef  LIMIT 1 )) propX_3_1<br />
FROM (SELECT SET(@rownr,@rownr+1) rownr, * FROM (select filter.id,filter.ver,filter.created_by,concat(concat(concat(concat(concat(t.name,&#8217;[@pk='),filter.id),'.'),filter.ver),']&#8216;) xpathPref ,(SELECT sub.FINT FROM FX_CONTENT_DATA sub WHERE sub.id=filter.id AND sub.ver=filter.ver AND TPROP=105 AND (sub.lang=1 OR sub.ismldef=true) /*ORDER BY sub.ismldef  LIMIT 1*/ ) prop_3_0<br />
,null<br />
FROM FXS_SEARCHCACHE_MEMORY filter, FXS_TYPEDEF t WHERE search_id=410 AND filter.tdef=t.id  AND filter.TDEF=6  ORDER BY 5 desc)) filter ORDER BY 1</p>
<p>&gt;<br />
&gt; &gt; webfrontend &#8230; remove a database called flexive all databases that begin with the term flexive and exist in the same directory are removed as well<br />
&gt;<br />
&gt; I can&#8217;t reproduce this problem with the current version.</p>
<p>With version 1.1.103 and removing &#8220;flexive&#8221; and having flexiveTest and flexiveConfiguration the command line you print in the webfrontend is<br />
java -cp h2.jar org.h2.tools.DeleteDbFiles   -dir &#8220;~&#8221; -db &#8220;flexive&#8221;</p>
<p>and I get this result which removes &#8220;flexive&#8221; and &#8220;flexiveTest&#8221;:</p>
<p>Processed: /home/mplesser/flexiveTest.lobs.db/245.t879.lob.db<br />
Processed: /home/mplesser/flexiveTest.lobs.db/158.t879.lob.db<br />
&#8230;..<br />
Processed: /home/mplesser/flexiveTest.lobs.db/98.t1077.lob.db<br />
Processed: /home/mplesser/flexive.index.db<br />
Processed: /home/mplesser/flexive.6.log.db<br />
Processed: /home/mplesser/flexive.data.db<br />
Processed: /home/mplesser/flexive.lobs.db/83.t205.lob.db<br />
&#8230;<br />
Processed: /home/mplesser/flexive.lobs.db/120.t205.lob.db<br />
Processed: /home/mplesser/flexive.lobs.db</p>
<p>Please let me know if I can further assist you in looking at these issues.<br />
I could help you to run and setup the flexive testcases to reproduce this easily.</p>
<p>Cheers and thanks,<br />
Markus</p>
<p>(this is a crosspost from the H2 mailinglist)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mueller</title>
		<link>http://blog.flexive.org/2008/12/05/porting-flexive-to-the-h2-database/#comment-7</link>
		<dc:creator>Thomas Mueller</dc:creator>
		<pubDate>Wed, 10 Dec 2008 22:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexive.org/?p=55#comment-7</guid>
		<description>&gt;insert into ... (select ... from) will throw an error
&gt;@rownum:=@rownum+1

Those two features are now implemented and will be available in the next release (1.1.105 and newer).

&gt; Query timeouts: statement.setQueryTimeout(15/*seconds*/); is not working

I can&#039;t reproduce this problem. What version of H2 do you use? Maybe
an old version of H2 is in the classpath?

&gt; Order By: ... issues if used in a subquery in the main queries where clause: the query parser just wont compile the query.

I can&#039;t reproduce the problem, but I remember there were problems so
time ago. How does the query look like exactly?

&gt; webfrontend ... remove a database called flexive all databases that begin with the term flexive and exist in the same directory are removed as well

I can&#039;t reproduce this problem with the current version.</description>
		<content:encoded><![CDATA[<p>&gt;insert into &#8230; (select &#8230; from) will throw an error<br />
&gt;@rownum:=@rownum+1</p>
<p>Those two features are now implemented and will be available in the next release (1.1.105 and newer).</p>
<p>&gt; Query timeouts: statement.setQueryTimeout(15/*seconds*/); is not working</p>
<p>I can&#8217;t reproduce this problem. What version of H2 do you use? Maybe<br />
an old version of H2 is in the classpath?</p>
<p>&gt; Order By: &#8230; issues if used in a subquery in the main queries where clause: the query parser just wont compile the query.</p>
<p>I can&#8217;t reproduce the problem, but I remember there were problems so<br />
time ago. How does the query look like exactly?</p>
<p>&gt; webfrontend &#8230; remove a database called flexive all databases that begin with the term flexive and exist in the same directory are removed as well</p>
<p>I can&#8217;t reproduce this problem with the current version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mueller</title>
		<link>http://blog.flexive.org/2008/12/05/porting-flexive-to-the-h2-database/#comment-6</link>
		<dc:creator>Thomas Mueller</dc:creator>
		<pubDate>Wed, 10 Dec 2008 22:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexive.org/?p=55#comment-6</guid>
		<description>&quot;id and version of a content instance as the primary key and rely on references to the id&quot;

This is expected behavior, you would also get an exception on PostgreSQL, Derby, and HSQLDB (I didn&#039;t test other databases).

drop table parent;
drop table child;
create table parent(a int, b int, primary key(a, b));
insert into parent values(1, 1);
insert into parent values(1, 2);
create table child(c int, foreign key(c) references parent(a));

H2: Unique index or primary key violation: CONSTRAINT_INDEX_8  ON
PUBLIC.PARENT(A)
PostgreSQL: ERROR: there is no unique constraint matching given keys
for referenced table &quot;parent&quot; 42830/0
Derby: Constraint &#039;SQL081208162825440&#039; is invalid: there is no unique
or primary key constraint on table &#039;&quot;SA&quot;.&quot;PARENT&quot;&#039; that matches the
number and types of the columns in the foreign key.
HSQLDB: Primary or unique constraint required on main table</description>
		<content:encoded><![CDATA[<p>&#8220;id and version of a content instance as the primary key and rely on references to the id&#8221;</p>
<p>This is expected behavior, you would also get an exception on PostgreSQL, Derby, and HSQLDB (I didn&#8217;t test other databases).</p>
<p>drop table parent;<br />
drop table child;<br />
create table parent(a int, b int, primary key(a, b));<br />
insert into parent values(1, 1);<br />
insert into parent values(1, 2);<br />
create table child(c int, foreign key(c) references parent(a));</p>
<p>H2: Unique index or primary key violation: CONSTRAINT_INDEX_8  ON<br />
PUBLIC.PARENT(A)<br />
PostgreSQL: ERROR: there is no unique constraint matching given keys<br />
for referenced table &#8220;parent&#8221; 42830/0<br />
Derby: Constraint &#8216;SQL081208162825440&#8242; is invalid: there is no unique<br />
or primary key constraint on table &#8216;&#8221;SA&#8221;.&#8221;PARENT&#8221;&#8216; that matches the<br />
number and types of the columns in the foreign key.<br />
HSQLDB: Primary or unique constraint required on main table</p>
]]></content:encoded>
	</item>
</channel>
</rss>
