Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-20 Thread davide.cavestro
ad the .sql file, or at least > the > interesting part (the summary and the transaction log)? Obviously of a > case > where the database has grown very large. > > Regards, > Thomas > > > > On Tue, Aug 20, 2013 at 1:03 PM, davide.cavestro > < > davide.c

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-20 Thread davide.cavestro
Hi, I realized that I ran my last tests with the old /PreparedStatement.setCharacterStream()/ instead of /PreparedStatement.setString()/. It seems that removing both /setCharacterStream()/ usage and connection pooling the db size doesn't increase. So I have shared at https://gist.github.com/davidec

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-20 Thread davide.cavestro
I agree with you. Running the Recover tool with the "-transactionLog" option gave me no evidences. Is there some particular section of the sql file I should examine? Follows an excerpt from the recover output when ran on a database that had no problems on the 2nd import (no errors on the trace fi

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-20 Thread davide.cavestro
Noel Grandin wrote > This looks to me like you have code that is allocating connections > from a pool, making some changes, not committing those changes, and > not bothering to close the connection. When using the connection pooling datasource, the connection is certainly reused and potentially no

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-19 Thread davide.cavestro
could lead to other side-effects (such as db size increase?). Cheers Davide Noel Grandin wrote > On 2013-08-19 09:44, davide.cavestro wrote: >> didn't notice) and eventually debug. It would indeed be very useful if I >> had >> some sort of API (even H2 internal) e

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-19 Thread davide.cavestro
e > Hi, > > About setCharacterStream: I would use setString for strings that easily > fit > in memory. > > About the negative numbers: why don't you post which numbers where > negative? I guess it's a bug in the Recover tool (using int instead of > lo

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-14 Thread davide.cavestro
losed, committed, or rolled > back. > > Regards, > Thomas > > > > > On Wed, Aug 14, 2013 at 4:01 PM, davide.cavestro < href="javascript:_e({}, 'cvml', 'davide.caves...@gmail.com');" > target="_blank">davide.cavestro@...> wrote

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-14 Thread davide.cavestro
hat the row count is kept into an integer variable, and I simply exceeded /Integer.MAX_SIZE/? Noel Grandin wrote > On Tue, Aug 13, 2013 at 5:56 PM, davide.cavestro > < > davide.cavestro@ > > wrote: >> I've tried replacing setCharacterStream() with setString() but

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-14 Thread davide.cavestro
runthe recovery tool, and post the statistics part of the the output? > Andthen, could you shrink the file (for example by export to SQL script > /import from SQL script), run recovery again, and post the statistics > ofthis new file?Regards,ThomasOn Tue, Aug 13, 2013 at 6:27 PM, >

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-14 Thread davide.cavestro
could you shrink the file (for example by export to SQL script / > import from SQL script), run recovery again, and post the statistics of > this new file? > > Regards, > Thomas > > > On Tue, Aug 13, 2013 at 6:27 PM, davide.cavestro > < > davide.cavestro@ >

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-13 Thread davide.cavestro
new file? > > Regards, > Thomas > > > On Tue, Aug 13, 2013 at 6:27 PM, davide.cavestro <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4027133&i=0> > > wrote: > >> I didn't measure it, but it was certainly lower

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-13 Thread davide.cavestro
I didn't measure it, but it was certainly lower. I'll give you more data asap. Noel Grandin wrote > On Tue, Aug 13, 2013 at 5:56 PM, davide.cavestro > < > davide.cavestro@ > > wrote: >> I've tried replacing setCharacterStream() with setString() but the db

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-13 Thread davide.cavestro
rmance as a whole should improve. > > On 2013-08-12 17:56, davide.cavestro wrote: >> I confirm that values for CHAR, VARCHAR and LONGVARCHAR columns are set >> and >> read through /CharacterStream/s. >> Basically we have a proprietary ORM that maps every String-related

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-12 Thread davide.cavestro
. Noel Grandin wrote > On 2013-08-12 17:15, davide.cavestro wrote: >> Follows a partial call stack for a /Connection.close()/ call. I took it >> at >> JVM shutdown time for the Tomcat main thread on a JRockit JVM : >> > > > The DB size issue is probably down

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-12 Thread davide.cavestro
se()/ call. I took it at JVM shutdown time for the Tomcat main thread on a JRockit JVM : H2 version is 1.3.169. Cheers Davide Noel Grandin wrote > On Fri, Aug 9, 2013 at 6:42 PM, davide.cavestro > < > davide.cavestro@ > > wrote: >> I actually don't use LOBs (could

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-09 Thread davide.cavestro
Sorry... in my previous post I mentioned the raw h2 driver wrapper we developed but didn't complete the sentence: maybe it could be the cause of the strange behavior... I'll check if the problem persists using the original driver. Cheers Davide -- View this message in context: http://h2-databa

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-09 Thread davide.cavestro
;ve not found yet a way to disable auto commit from h2 console > > There is a "auto commit" checkbox in the toolbar. > > Regards, > Thomas > > > > On Wednesday, August 7, 2013, davide.cavestro wrote: > >> I have a similar problem with a legacy data

Re: [h2] Database-level custom serialization for columns of type OTHER: patch proposal

2013-08-07 Thread davide.cavestro
_SCHEMA.SETTINGS/ (supposing it should be reflected there). Noel Grandin wrote > Hi > > On 2013-08-07 12:52, davide.cavestro wrote: >> 1. Could you please give me a hint on where the parameter /CACHE_SIZE/ is >> loaded from the JDBC URL? I still don't understand why >> /

Re: [h2] Database-level custom serialization for columns of type OTHER: patch proposal

2013-08-07 Thread davide.cavestro
message to //h2/src/main/org/h2/res/_messages_en.prop/ and //h2/src/docsrc/textbase/_messages_en.prop/ as they are both under version control... maybe one is derived from the other? Cheers Davide Noel Grandin wrote > On 2013-08-02 12:31, davide.cavestro wrote: >> Hi Noel, I v

Re: [h2] Continuous Increase in H2 db size after dropping and loading same data repeatedly

2013-08-07 Thread davide.cavestro
I have a similar problem with a legacy data import library that should commit every N rows batch inserts and also at the end of every table import. Before importing data I drop all the objects. However the db size increase at every import within the same jvm instance. At shutdown, it seems like h2

Re: [h2] Database-level custom serialization for columns of type OTHER: patch proposal

2013-08-02 Thread davide.cavestro
T COLLATION i.e. it can only be executed before any > tables are defined. >see http://h2database.com/html/grammar.html#set_collation >and the logic in the org.h2.command.dml.Set class and the > Parser#parseSetCollation() method. >But I'm happy to add that part in later i

[h2] Database-level custom serialization for columns of type OTHER: patch proposal

2013-07-25 Thread davide.cavestro
I need a way to use custom serialization (kryo based) only for a certain H2 db, while other dbs (on the same JVM instance) should continue using standard serialization. I've seen some time ago a guy asked something similar

Re: [h2] TestReadOnly and TestFileLockSerialized failing: patch proposal

2013-07-23 Thread davide.cavestro
That's great, I'll work on other failing tests ASAP. Cheers Davide Noel Grandin wrote > On 2013-07-19 22:56, Davide Cavestro wrote: >> /TestFileLockSerialized/ fails probably because my netbook is veeery >> slow, and the test code uses /Thread.sleep()/ in order to coordinate >> threads: I've re

[h2] Re: Any chance to achieve better performances for OTHER columns through "jboss-serialization" library?

2013-07-02 Thread davide.cavestro
Hi, sorry for the long delay. Even if I am not a micro-benchmark fan, today I've sketched a raw comparison of h2 serialization for jboss-serialization, apache kryo and h2 native serialization. I've shared a gist with the test code and a spreadshe

Re: JdbcXAConnection.PooledJdbcConnection.checkClosed() performance

2013-05-14 Thread davide.cavestro
arefully. > And given how often connection pooling libraries manage to get it wrong, > it makes a lot of sense. > > On 2013-05-14 13:02, davide.cavestro wrote: >> Hi, >> I noticed that / >> JdbcXAConnection.PooledJdbcConnection.checkClosed(boolean) >> <http://h2

JdbcXAConnection.PooledJdbcConnection.checkClosed() performance

2013-05-14 Thread davide.cavestro
Hi, I noticed that / JdbcXAConnection.PooledJdbcConnection.checkClosed(boolean) / is a /synchronized/ method. Also taking some random thread dumps I noticed it seems called very frequently

Re: JdbcXAConnection and transaction timeout (The object is already closed)

2013-05-13 Thread davide.cavestro
Generically it is the more likely cause, but the same legacy code was written and battle proven using some DBMS like PostgreSQL, Oracle and SQLServer with the same Transaction Manager. They all work fine with some adaptations, i.e. for SQL server we had to configure the server-side Transaction Coor

JdbcXAConnection and transaction timeout (The object is already closed)

2013-05-13 Thread davide.cavestro
Hi, I've configured a H2 XA datasource to be orchestred by JBossTS. Sometimes I get some failures complaining /Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed [90007-169] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get

Re: huge performance difference between SELECT ... WHERE x IN (1,2) and SELECT ... WHERE (x=1) OR (x=2)

2013-04-22 Thread davide.cavestro
Now it works like a charm :-) Thank you very much Davide Noel Grandin wrote > Thanks for the good testing! > > Fixed in SVIN. > > On 2013-04-22 12:13, davide.cavestro wrote: >> Many thanks for your fast fix: however I noticed the SELECT COUNT that >> uses the

Re: huge performance difference between SELECT ... WHERE x IN (1,2) and SELECT ... WHERE (x=1) OR (x=2)

2013-04-22 Thread davide.cavestro
Noel Grandin wrote > Fixed in SVN. > > Looks like I introduced the bug when I did the ConditionInConstantSet > performance thing. Many thanks for your fast fix: however I noticed the SELECT COUNT that uses the OR condition now give wrong result (0 rows)... do you confirm it? Please try the foll

huge performance difference between SELECT ... WHERE x IN (1,2) and SELECT ... WHERE (x=1) OR (x=2)

2013-04-17 Thread davide.cavestro
I've noticed a huge performance difference between a query with some conditions expressed through a IN clause and the corresponding OR conditions sequence. H2 uses uses indexes in the former, while it does a tableScan with the latter. Here you are a reproducible test case: where the explain anal

A scalar subquery doubt

2013-02-06 Thread davide.cavestro
Hi, I'm going to use a scalar subquery into a view, and I've found that I have to use an aggregation function (i.e. MAX) in order obtain the right results. Here you are a sample. This is the data set, where I have two tables: * TASK is the master * WORKLOG is the slave TASK is organized into tree

Re: Voting up for SQL Trigger

2013-02-04 Thread davide.cavestro
Thomas Mueller-6 wrote > Sure, I will increase the priority. Hi Thomas, sorry for resurrecting this old thread, but I also don't want to cross-post... so I resolved to write here. After some years it seems like /Sql triggers/ are still /Priority 2/. Hence I guess there's no enough demand from ot