[h2] trace file format

2013-10-08 Thread Thomas Mueller
Hi, > So, if accu is less than 100%, the rest of the time went where? To other queries or statements that are below that line. And if self is less than accu in hprof it has to do with sub-function > execution time, I believe > No. Self mean self, I don't know how to explain it otherwise sorry.

[h2] jdbc:h2:mem: threadsafe?

2013-10-08 Thread Thomas Mueller
Hi, I think the documentation is quite clear. Of course in Java, you can pass around objects to any thread you like. If your application has a handle on an object, you can also call methods on it concurrently in multiple threads. H2 is thread-safe (as documented), but there are parts of the JDBC

[h2] csvread interprets unqoted zero-length string as null even when null value is explicitly given.

2013-10-07 Thread Thomas Mueller
Hi, If course you could change the CSV source code; it is so small that "rolling your own" might not be a problem even in the long run. > H2 has decided that a particular representation of the zero-length string always means NULL. Yes, so far. Even thought there is a relatively simple and clear

Re: [h2] Misleading error when parsing an invalid INNER JOIN query missing the comma before last field reference

2013-10-07 Thread Thomas Mueller
Hi, Yes, that's weird. I found the problem now. The test case: create table test(a int, b int); select t.a, t.b t.c from test t; The parser thinks the statement finishes at select t.a, t.b t and then doesn't find the column. I will try to fix the parser. Thanks for reporting! Reg

Re: [h2] unable to write: "the database is read only" after system crash

2013-10-07 Thread Thomas Mueller
Hi, I'm sorry, but I'm not familiar with JBoss. I know that the 2-phase-commit implementation of H2 is currently incomplete, and probably this is the root cause of the problem. What H2 can't do currently is: after a crash, in the recovery phase, H2 doesn't allow to start a new transaction until a

Re: [h2] latest checkout from svn throws build exception

2013-10-07 Thread Thomas Mueller
Hi, Yes, the formatting of the file "help.csv" was broken. It should be fixed now. Regards, Thomas On Tue, Oct 8, 2013 at 12:12 AM, WillyMac wrote: > > src2/h2database-read-only/h2$ ./build.sh jar > Target: jar > Deleting temp > Deleting docs > Compiling 593 classes > Copying 1 files to temp

Re: [h2] Small MVMap reopen bug?

2013-10-07 Thread Thomas Mueller
Hi, I think I will remove MVMap.close(). I currently don't see a reason to support it. For read-only maps, Java garbage collection should release the memory, and for writable maps, MVMap.close() is problematic. One possible use case is to make the map read-only, but I don't think it's a strong eno

Re: [h2] Re: trace file format

2013-10-07 Thread Thomas Mueller
Hi, > Are the fields in the trace file documented? Like so: > /*SQL l:1829 #:564 t:5*/ > What are l, #, and t? The fields are not documented, except in the source code (Trace.java). They are: length of statement, number (count) and time. > Is "time" the wall-clock time, or cpu time given to h2?

Re: [h2] table() syntax

2013-10-07 Thread Thomas Mueller
Hi, See http://h2database.com/html/functions.html#table Regards, Thomas On Mon, Oct 7, 2013 at 9:06 PM, Brian Craft wrote: > From the performance docs: > > PreparedStatement prep = conn.prepareStatement( > "SELECT * FROM TABLE(X INT=?) T INNER JOIN TEST ON T.X=TEST.ID"); > prep.setObject

Re: [h2] PreparedStatement with a lot of indexed Parameters hangs up and takes CPU - but there is no error message

2013-10-07 Thread Thomas Mueller
Hi, I guess the query is slow for some reason, possibly because there is no index. Did you already check the documentation at http://h2database.com/html/performance.html#explain_plan ? Regards, Thomas On Sun, Oct 6, 2013 at 10:27 PM, Markus Fengler wrote: > Hi, > > I want to get a ResultSet an

Re: [h2] Problem handling a lot of parameters - query does not come to an end

2013-10-07 Thread Thomas Mueller
Hi, I guess the query is slow for some reason, possibly because there is no index. Did you already check the documentation at http://h2database.com/html/performance.html#explain_plan ? Regards, Thomas On Sun, Oct 6, 2013 at 10:45 PM, Markus Fengler wrote: > Hi, > > I hava a query with a lot of

Re: [h2] threads and "where .. in" queries

2013-10-07 Thread Thomas Mueller
Hi, > a "where ... in" clause with 500 values (like "where x in [v0, v1, v2, v499]"), which ran with average time 120 seconds. 120 seconds for 500 entries sounds like a problem with the data or the query. Do you have an index on that column? See also http://h2database.com/html/performance.ht

Re: [h2] csvread interprets unqoted zero-length string as null even when null value is explicitly given.

2013-10-05 Thread Thomas Mueller
Hi, > Maybe it is intended to work this way Yes, an empty value ("a,,c") is always treated as "null" currently. > Why bother specifying null=xxx if ,, is read as null anyway? This feature for compatibility, it is only needed to support reading existing CSV files that contain explicit "null" del

Re: [h2] Small MVMap reopen bug?

2013-10-05 Thread Thomas Mueller
Hi, Yes, this is a bug, I will fix it. Thanks for reporting it! Regards, Thomas On Thu, Oct 3, 2013 at 1:31 AM, Brian Bray wrote: > This test throws a "Map is closed" exception (in 1.3.173) and I don't > believe it should. Looks like MVMap.openMap(...) is not checking for > "!old.isClosed()

Re: [h2] corrupt database 1.3.168

2013-10-01 Thread Thomas Mueller
upgrading h2.jar along in my app. > If this is a problem (using this db file against an uptodate h2.jar), > please tell me. > > Op woensdag 21 augustus 2013 07:43:45 UTC+2 schreef Thomas Mueller: > >> Hi, >> >> The empty database was created with version 1.3.161, as t

Re: [h2] unable to write: "the database is read only" after system crash

2013-10-01 Thread Thomas Mueller
Hi, Well, do you use two-phase commit? Could you check if there are any in-doubt transactions, by running "select * from information_schema.in_doubt"? If yes, those transactions need to be either rolled back or committed first. If no, then I wonder whether you explicitly open the database in read

Re: [h2] NPE when calling MVStore.open() with a pathname without parent part

2013-09-28 Thread Thomas Mueller
Hi, Thanks a lot! This should be fixed now with revision 5166. Regards, Thomas On Sat, Sep 28, 2013 at 12:22 AM, wrote: > Hi, > > when calling something like MVStore.open("test.mvstore"), the program > abort on NPE: > > Exception in thread "main" java.lang.NullPointerException > at o

Re: [h2] Parameter Handling Bug

2013-09-28 Thread Thomas Mueller
test case with source code? Regards, Thomas On Wed, Sep 25, 2013 at 7:35 PM, Mike Goodwin wrote: > I replied off the list with a link to download a test case. > > - mike > > > On Tue, Sep 24, 2013 at 6:29 PM, Thomas Mueller < > thomas.tom.muel...@gmail.com> wrote: &

Re: [h2] Re: Known issues with large databases

2013-09-27 Thread Thomas Mueller
Hi, No, sorry. Regards, Thomas Hello, thank you for the answer. Are you aware of performance/corruption issues if for example the db has only one table containing lots of rows (e.g. > 600k)? Thank you Federico On Wednesday, September 18, 2013 6:57:23 PM UTC+2, Thomas Mueller wrote: >

Re: [h2] Re: Error 90052, Subquery is not a single column query

2013-09-24 Thread Thomas Mueller
Hi, No, I'm sorry, I don't have a solution for this. Patches are welcome! According to my test, MySQL, PostgreSQL, and HSQLDB support this. Apache Derby and H2 do not. I think the typical solution would be to use a join. Regards, Thomas On Fri, Sep 20, 2013 at 6:38 PM, Markus Waltl wrote: >

Re: [h2] Parameter Handling Bug

2013-09-24 Thread Thomas Mueller
Hi, There were a few issues about parameter indexes in combination with views or subqueries in the past, it's possible that there are remaining issues. > I can provide a standalone, albeit complicated test case for this issue. That would be great! I wouldn't want to change the code without havi

Re: [h2] Re: Re: Re: Insert if row does not already exist, cache PreparedStatement in a function

2013-09-24 Thread Thomas Mueller
if there was a better way. Thanks, Gili On Sunday, September 22, 2013 8:09:45 AM UTC-4, Thomas Mueller wrote: > Hi, > > > How can we insert a new row unless one already exists, and in either > case return the primary key of the inserted/matched row? > > Well, how could you insert

Re: [h2] packaging a database for deployment

2013-09-22 Thread Thomas Mueller
Hi, This is basically a duplicate of this question: http://stackoverflow.com/questions/18924873/h2-embedded-database-loses-tables-data-on-deploymen Regards, Thomas On Sat, Sep 21, 2013 at 8:34 PM, Josh wrote: > Hi there, > > I need a step by step instructions on how to get a database to be d

Re: [h2] Re: Re: Re: Insert if row does not already exist, cache PreparedStatement in a function

2013-09-22 Thread Thomas Mueller
ly what you are suggesting? >> >> I guess that I don't see how I'm going to get the ID back to the client >> using this mechanism. Can you provide an example? >> >> Thanks! >> >> >> On Thu, Oct 25, 2012 at 11:16 AM, Thomas Mueller >>

Re: [h2] lots of schemes vs lot of tables?

2013-09-21 Thread Thomas Mueller
> I have answered on the thread. > > Thanks for your replies, > Josh > > Sent from my BlackBerry 10 smartphone. > *From: *Thomas Mueller > *Sent: *Saturday 21 September 2013 9:50 PM > *To: *H2 Google Group > *Reply To: *h2-database@googlegroups.com > *Subject

Re: [h2] lots of schemes vs lot of tables?

2013-09-21 Thread Thomas Mueller
chema and table metadata is kept fully in memory >> >> >> I see the problem. For instance, how much memory would require >> (approximately) 10.000 schemes x 10 tables = 110.000 object medata? Would >> that magnitude order be of Megas or Gigas? Megas might be acceptable.

Re: [h2] MVStore question

2013-09-21 Thread Thomas Mueller
Hi, > MVStore (version 1.3.172) It is changing quite quickly, I suggest to use the latest version (1.3.173, or even better, the latest automated build at http://h2database.com/html/download.html (direct link: http://www.h2database.com/automated/h2-latest.jar ) > I simply use a Map where key and

Re: [h2] showing tuning parameters

2013-09-21 Thread Thomas Mueller
Hi, Yes: SELECT * FROM INFORMATION_SCHEMA.SETTINGS Regards, Thomas On Sat, Sep 21, 2013 at 4:36 AM, Brian Craft wrote: > Is there a way to show the current values of the various tuning > parameters, like cache_size? > > -- > You received this message because you are subscribed to the Google

Re: [h2] lots of schemes vs lot of tables?

2013-09-21 Thread Thomas Mueller
gt; > The code above ensures that the user views only his tables (and data) by > default. > > I'm not expert and you know much better the database internals, how it > scales and how to prevent future problems... I'll change my current model > (many schemas) to a single schem

Re: [h2] H2 Embedded Database loses tables / data on deploymen

2013-09-21 Thread Thomas Mueller
Hi, Please don't double post. You have asked this question also at http://stackoverflow.com/questions/18924873/h2-embedded-database-loses-tables-data-on-deploymen Regards, Thomas On Fri, Sep 20, 2013 at 9:59 PM, Josh Harington wrote: > Hi Guys, > > So I have an application, and it uses a datab

Re: [h2] Would it not be better if AVG did a cast?

2013-09-20 Thread Thomas Mueller
Hi, What do other database do? Regards, Thomas Am 10.09.2013 15:58 schrieb "Cecil Westerhof" : > When AVG is used on a column that has INT data, the result is an INT. > Would it not be better to cast it to a DOUBLE? Now I need to do something > like: > ROUND(AVG(CAST(total AS DOUBLE)), 2) AS

Re: [h2] lots of schemes vs lot of tables?

2013-09-20 Thread Thomas Mueller
Hi You could do both, but I would use one schema. (the title of the mail is incorrect: many schemas is many tables, which is what I would avoid). Regards, Thomas Am 12.09.2013 17:54 schrieb "Pablo Beltran" : > Hi, > > I need to store lot of data (even millions of records) on an small bunch > of

Re: [h2] Re: ODBC

2013-09-20 Thread Thomas Mueller
Hi, Sorry, you can not use "CIPHER=AES" in the ODBC connection string. This is only allowed in the JDBC database URL. You would need to set the database name to "GE04;CIPHER=AES", but I'm not sure if this is possible or how to do it. Or, as a workaround, you could start the PgServer with an undo

Re: [h2] Communication closed during authentication;Socket has been closed

2013-09-20 Thread Thomas Mueller
Hi, Please don't double post. Here my answer again (in case somebody else searches for this): Sorry, you can not use "CIPHER=AES" in the ODBC connection string. This is only allowed in the JDBC database URL. You would need to set the database name to "GE04;CIPHER=AES", but I'm not sure if this i

Re: [h2] Re: Known issues with large databases

2013-09-18 Thread Thomas Mueller
Hi, > there are no known performance issues on large databases Not that I'm aware of, no. Regards, Thomas On Wed, Sep 18, 2013 at 10:08 AM, Federico Dal Castello < federico.dalcaste...@mindmercatis.com> wrote: > Should I suppose that there are no known performance issues on large > database

Re: [h2] Re: Unable to set h2.lobInDatabase=false

2013-09-18 Thread Thomas Mueller
Hi, It is still supported in 1.3.x. It will not be supported in 1.4.x any longer however. Because of that, there are no plans to improve support for external files. I'm not quite sure if we still have unit tests where this this setting is disabled. I guess the problem is that you need to set the

Re: [h2] Performance issues with Hibernate Application

2013-09-13 Thread Thomas Mueller
Hi, Please don't double post: http://stackoverflow.com/questions/18782331/how-can-i-stop-h2-being-in-blocking-my-hibernate-querys-so-much Regards, Thomas On Fri, Sep 13, 2013 at 12:02 PM, Thomas Mueller < thomas.tom.muel...@gmail.com> wrote: > Hi, > > There are threads th

Re: [h2] log and undo_log

2013-09-13 Thread Thomas Mueller
Hi, As documented, LOG is the transaction log, it is shared among all sessions. See also http://en.wikipedia.org/wiki/Transaction_log http://h2database.com/html/grammar.html#set_log UNDO_LOG is per session, to undo an operation (an update that fails for example) and to rollback a transaction. Th

Re: [h2] Differences between H2SQL and PostgreSQL

2013-09-13 Thread Thomas Mueller
Hi, I'm afraid there is no simple comparison table. The H2 SQL grammar is documented at http://h2database.com/html/grammar.html The PostgreSQL grammar is documented at http://www.postgresql.org/docs/8.1/static/sql.html Regards, Thomas On Fri, Sep 13, 2013 at 11:03 AM, Stefan Albracht wrote:

Re: [h2] Performance issues with Hibernate Application

2013-09-13 Thread Thomas Mueller
Hi, There are threads that are blocked, that might be, yes, but I would *first* concentrate on those threads that are _not_ blocked, that means that are consuming the CPU time or disk I/O. What statements are those? Are they queries that don't use an index? Do you have indexes? Or do you unnecessa

Re: [h2] strategies for large transactions

2013-09-12 Thread Thomas Mueller
Hi, For memory problems: What I usually first use is "jmap -histo " to get an overview. It usually works with recent versions of Java, sometimes you have to try a few times and sometimes you have to use -F. Rarely you have to use -histo:live. Afterwards, if I need to further analyze, I use -XX:+

Re: [h2] Need help with query

2013-09-12 Thread Thomas Mueller
Hi, This is a generic SQL question. I would simplify the question and ask it at StackOverflow.com Regards, Thomas On Thu, Sep 12, 2013 at 12:38 AM, Anders wrote: > Hi, > > I need help with creating a query. > > Currently it looks like this > > SELECT > COUNT(*) AS ALERTS, > EXTRACT (YEAR FRO

Re: [h2] MVStore#getRetainVersion() appears to always return -1

2013-09-12 Thread Thomas Mueller
Hi, MVStore.getRetainVersion is used internally by MVMap.removeUnusedOldVersions. Maybe the method should be renamed, and a new method getRetainVersion should be added that returns the value you passed in the setter. And you are right the "if" statement is strange: if (currentStoreVersion >=

Re: [h2] Using MVStore in OSGi

2013-09-12 Thread Thomas Mueller
debug it. Regards, Thomas On Thu, Sep 12, 2013 at 2:01 AM, Paul F Fraser wrote: > On 12/09/13 04:08, Thomas Mueller wrote: > > Hi, > > Which version of H2 did you try? > > 1.3.173 > > > > It bombs out > > Well, is there a stack trace? Could you

Re: [h2] Maven pom misses some informations for version 1.3.173

2013-09-11 Thread Thomas Mueller
H2 Database Engine >> >> >> The H2 License, Version 1.0 >> http://h2database.com/html/license.html >> repo >> >> >> >> scm:svn:http://h2database.googlecode

Re: [h2] Using MVStore in OSGi

2013-09-11 Thread Thomas Mueller
Hi, Which version of H2 did you try? > It bombs out Well, is there a stack trace? Could you post it? As far as I know, H2 works in an OSGi environment. The regular database also uses FilePath... > the full H2 jar does not export mvstore Good point, I need to fix that. Unfortunately I'm very b

Re: [h2] Database corrupted after java.lang.ArrayIndexOutOfBoundsException

2013-09-11 Thread Thomas Mueller
Hi, The error code "[5-166]" means you are actually still using H2 version 1.3.166. A few corruption problems have been fixed since then, for example in version 1.3.172 ("When using local temporary tables...") and also 1.3.173 - see also http://www.h2database.com/html/changelog.html - could y

Re: [h2] strategies for large transactions

2013-09-10 Thread Thomas Mueller
Hi, It depends on how you do the import. Could you get a heap histogram for a large import (jmap -histo:live ), and could you tell us how you do the import exactly? If you use "create table ... as select" then it can't run out of memory (as far as I know), because no undo log is needed. If you e

Re: [h2] Data loss with H2 HA / Clustered Mode

2013-09-06 Thread Thomas Mueller
Hi, I wrote the current cluster implementation, but I understand it has many limitations. If I would do it again, I would now use a different approach, more like what MongoDB does: use replication for failover and read scalability, and use partitioning for write scalability. The current implementa

Re: [h2] MySql sequence to H2 sequence

2013-09-06 Thread Thomas Mueller
Hi, H2 does support user defined functions, but they have to be written in Java. See the documentation (Features / User-Defined Functions and Stored Procedures) for details. Regards, Thomas On Friday, August 30, 2013, Rajiv Perera wrote: > > On Thu, Aug 29, 2013 at 6:09 PM, Thomas M

Re: [h2] Possible to recover data after 'data' file deletion from index/log files?

2013-09-06 Thread Thomas Mueller
Hi, The idea is to _either_ use StackOverflow _or_ the mailing list. But not both. I suggest to ignore this email and use http://stackoverflow.com/questions/18655477/is-it-possible-to-recover-h2db-data-after-deleting-data-fileinstead. Regards, Thomas On Fri, Sep 6, 2013 at 11:31 AM, Paula Sant

Re: [h2] How to specify blank (or no) username password for Script/Shell Command Line Tools

2013-09-05 Thread Thomas Mueller
Hi, An empty user name or password can be set using "" (two double quotes). That works for me at least. Maybe you have used different quotes? Regards, Thomas On Wednesday, August 28, 2013, Peter wrote: > h2-1.3.173.jar > Windows 7, Powershell and Cmd > > I created a H2 database in a java pgm wi

Re: [h2] Script / Shell username password blank issues

2013-09-05 Thread Thomas Mueller
Hi, I believe the correct way to specify an empty user name is java ... -user "" (that means, without the single quotes). If you use '""' then the user name consists of two double quotes. At least that's what I get. Regards, Thomas On Wednesday, August 28, 2013, Peter wrote: > The required -

Re: [h2] Column not found error when combining select from multiple tables with LEFT JOIN

2013-09-04 Thread Thomas Mueller
Hi, This is not a bug. You are mixing "old style" (list of tables) joins with "new style" (left join). Other databases such as PostgreSQL, MySQL(!), and Apache Derby will also throw an exception (invalid reference to FROM-clause entry for table "a"; Unknown column 'A.ID' in 'on clause; Column 'A.I

Re: [h2] H2 more detailed Syntax Exception

2013-09-03 Thread Thomas Mueller
Hi, Could you also move the DbContextRule and related classes to the new package, for example org.h2.bnf.context? I can do it of course, but then merging changes would be a bit harder I guess. Regards, Thomas On Tue, Sep 3, 2013 at 4:54 PM, Nicolas Fortin (OrbisGIS) < nico.de...@gmail.com> wrot

Re: [h2] H2 more detailed Syntax Exception

2013-09-01 Thread Thomas Mueller
ity (protected) and it is not exported in OSGi. > May be I should write my own ? > > Thank you > > -Nicolas Fortin > Atelier SIG > IRSTV FR CNRS 2488 > > Le dimanche 1 septembre 2013 09:16:27 UTC+2, Thomas Mueller a écrit : >> >> Hi, >> >> So, I gu

Re: [h2] H2 more detailed Syntax Exception

2013-09-01 Thread Thomas Mueller
> to synchronize with the last update of the h2 parser. It seems that I can > feed the bnf with DatabaseMetaData, great. > > I'm on it. > > > -Nicolas Fortin > Atelier SIG > IRSTV FR CNRS 2488 > > > Le jeudi 29 août 2013 17:16:23 UTC+2, Thomas Mueller a écrit

Re: [h2] Computed column and _ROWID_: not updated when I think it should be

2013-09-01 Thread Thomas Mueller
Hi, I will document the limitation of the row id: "Please note the row id is not available until after the row was added (that means, it can not be used in computed columns or constraints)." > rowid int as convert(_rowid_, int) This doesn't work. You would have to use a sequence or auto-incremen

Re: [h2] CURRENT_DATE - 1

2013-09-01 Thread Thomas Mueller
Hi, CURRENT_DATE - 1, same as CURRENT_DATE - 0.5 and DATEADD, returns a timestamp. Regards, Thomas On Sat, Aug 31, 2013 at 3:49 PM, Noel Grandin wrote: > > > > On Sat, Aug 31, 2013 at 9:04 AM, Cecil Westerhof > wrote: > >> Does not make a difference (besides making the query bigger): >>

Re: [h2] MVStore Non-Unique keys

2013-08-29 Thread Thomas Mueller
t use the index key as the map key, and the primary key as the map value. Regards, Thomas On Thu, Aug 29, 2013 at 5:19 PM, Paul F Fraser wrote: > On 30/08/13 00:41, Thomas Mueller wrote: > > Hi, > > > Is it practical with MVStore to use a single key with a list as the > val

Re: [h2] H2 more detailed Syntax Exception

2013-08-29 Thread Thomas Mueller
) < nico.de...@gmail.com> wrote: > Hi, > > Yes I need this, as it will feed the console auto-completion. > > > -Nicolas Fortin > Atelier SIG > IRSTV FR CNRS 2488 > > Le jeudi 29 août 2013 16:31:28 UTC+2, Thomas Mueller a écrit : >> >> Hi, >> >&

Re: [h2] MVStore Non-Unique keys

2013-08-29 Thread Thomas Mueller
ds than writes. > > Regards, > Thomas > > > > On Thu, Aug 29, 2013 at 3:04 PM, Paul F Fraser wrote: > >> On 29/08/13 22:45, Thomas Mueller wrote: >> >> Hi, >> >> Why do you want to know, do you want to build you own secondary index >> and

Re: [h2] MVStore Non-Unique keys

2013-08-29 Thread Thomas Mueller
s very interesting! I guess using compression should help a lot in this case, and possibly using a larger page size - specially if you have more reads than writes. Regards, Thomas On Thu, Aug 29, 2013 at 3:04 PM, Paul F Fraser wrote: > On 29/08/13 22:45, Thomas Mueller wrote: > > Hi,

Re: [h2] H2 more detailed Syntax Exception

2013-08-29 Thread Thomas Mueller
really need the method "getExpectedTokens"? If yes, then >> JdbcSQLException could parse the error message and search for "expected:". >> > > I can't as this message can be translated or changed later. > > > -Nicolas Fortin > Atelier SIG >

Re: [h2] MVStore Non-Unique keys

2013-08-29 Thread Thomas Mueller
Hi, Why do you want to know, do you want to build you own secondary index and use MVStore directly? For the MVTableEngine, currently, the key of an index is a "Value", actually a "ValueArray". The last value of the ValueArray is the row id (which matches the primary key for bigint or int primary

Re: [h2] Help Convert MySql sequence to H2 sequence

2013-08-29 Thread Thomas Mueller
Hi, H2 supports sequences directly, no need to write complicated code as with MySQL. See alsohttp://h2database.com/html/grammar.html#create_sequence Create a sequence: create sequence abc; Getting the next value: select next value for abc; or select abc.nextval; Regards, Thomas On Thu, Aug 29

Re: [h2] MySql sequence to H2 sequence

2013-08-29 Thread Thomas Mueller
Hi, H2 supports sequences directly, no need to write complicated code as with MySQL. See also http://h2database.com/html/grammar.html#create_sequence Create a sequence: create sequence abc; Getting the next value: select next value for abc; or select abc.nextval; Regards, Thomas On Thu, Aug

Re: [h2] H2 more detailed Syntax Exception

2013-08-29 Thread Thomas Mueller
Hi, The current solution doesn't work for the client/server case. What about removing the JdbcParseSQLException interface, and extending JdbcSQLException with getSyntaxErrorPosition? It would return -1 if it's not a syntax exception, and would return the position if it is. Internally, JdbcSQLExc

Re: [h2] how to convert my mysql database to h2 with programming code in java?

2013-08-27 Thread Thomas Mueller
Hi, There are various tools that could help, see the Links section of the documentation: http://h2database.com/html/links.html#tools For example * Flyway : The agile database migration framework for Java. * SQuirreL DB Copy Plugin : Tool to cop

Re: [h2] RFE: Add session id to log

2013-08-24 Thread Thomas Mueller
ee. Do you need anything further from my end, or > will you get back to me on this issue? > > Thanks, > Gili > > > On 23/08/2013 12:54 PM, Thomas Mueller wrote: > > Hi, > > Thread name: I'm not sure if that's possible, but it sounds like a good > idea.

Re: [h2] H2 more detailed Syntax Exception

2013-08-24 Thread Thomas Mueller
Hi, I'm not convinced that using another exception class is a good idea. This new exception class has to be supported in multiple places (remoting the exception for example). What about extending the existing class (JdbcSQLException) with the required data? If it's not a parse exception, then the

Re: [h2] RFE: Add session id to log

2013-08-23 Thread Thomas Mueller
) > > Probably the easiest solution is to replace "Session " in the > deadlock message with "Thread ". That way I'd know what threads were > involved with the deadlock and be able to walk back up the log. Is that > possible? > > Thanks, > Gili

Re: [h2] How to Exclude Header?

2013-08-23 Thread Thomas Mueller
ownload the newest version of H2? > > Thanks! > > > On Friday, August 23, 2013 8:06:08 AM UTC-7, Thomas Mueller wrote: > >> >> Hi, >> >> It works for me, what version of H2 are you using? What I tried is: >> >> CALL CSVWRITE('~/temp/

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

2013-08-23 Thread Thomas Mueller
Hi, About the message "Transaction log could not be truncated": Yes, it's indeed a very good test case. I'm analyzing the problem now. I think the problem is somewhere in the PageStore or PageLog class. Possibly it's "only" an incorrect warning, but solving it might as well solve the original prob

Re: [h2] How to Exclude Header?

2013-08-23 Thread Thomas Mueller
Hi, It works for me, what version of H2 are you using? What I tried is: CALL CSVWRITE('~/temp/test.csv', 'SELECT 1 Hello, ''Hello'' World FROM dual', 'fieldDelimiter= writeColumnHeader=false') Regards, Thomas On Fri, Aug 23, 2013 at 3:08 PM, sc8132 wrote: > Hello, > > Hopefully s

Re: [h2] RFE: Add session id to log

2013-08-23 Thread Thomas Mueller
Hi, Well, you should know what statement was executed in the current session when the exception occurred, so you should be able to understand the message. Regards, Thomas On Fri, Aug 23, 2013 at 9:09 AM, Noel Grandin wrote: > > Look at: > http://h2database.com/html/**functions.html#session_id

Re: [h2] java.io.FileNotFoundException: h2errors.txt exception

2013-08-21 Thread Thomas Mueller
Hi, Yes, you are using quite an old version of H2 (about 2 years old). Also, did you set the property "h2.logAllErrors"? If yes, I suggest to disable it. This should solve the problem as well. Regards, Thomas On Wed, Aug 21, 2013 at 3:39 PM, Noel Grandin wrote: > Looks like something went w

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

2013-08-20 Thread Thomas Mueller
Hi, I suspect if you read mailing list messages from a mobile device you miss > preformatted contents... I posted the head and tail of the .sql file in my > previous post Well, I think you didn't post the content of the transaction log (not before, and not now). In your "test case", you have us

Re: [h2] In-Memory Database and TCP Server Queries

2013-08-20 Thread Thomas Mueller
Hi, What you could try is replace "debuggingDatabaseSleep(30)" with "org.h2.tools.Server.startWebServer(conn)". Regards, Thomas On Friday, August 16, 2013, Derek Price wrote: > I'm using IntelliJ with this code: > > @Test > public void testH2() throws SQLException { > Connection conn = null;

Re: [h2] Performance degradation in version 1.3.172 and newer for some queries.

2013-08-20 Thread Thomas Mueller
Hi, This problem should be fixed in the latest nightly build. Regards, Thomas On Friday, August 16, 2013, Thomas Mueller wrote: > Hi, > > Thanks a lot for reporting the problem and analyzing the root cause! > > I just found out the problem also exists without using MVCC. Mayb

Re: [h2] corrupt database 1.3.168

2013-08-20 Thread Thomas Mueller
Hi, The empty database was created with version 1.3.161, as the "CREATE_BUILD" is 161. Since then, a few bugs have been fixed that could cause corruption; see the change log for details. I suggest to try again with a more recent version of H2. If it is still a problem, it would be great if you cou

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

2013-08-20 Thread Thomas Mueller
race file and the db size increase/uncommitted > transactions are related, is there something I could do to detect the cause > (even debugging)? > > > Thomas Mueller-6 wrote > > Hi, > > > > Please note it's not the *size* of an uncommitted transaction that is

Re: [h2] H2 trunk, fix Geometry

2013-08-20 Thread Thomas Mueller
Hi, > About the OSGi manifest. If you don't want to expose more package in OSGi, how to use org.h2.api.TableEngine as it imports org.h2.table.TableBase ? Yes, that's a good question :-) And the method passes a CreateTableData, which is in another package. There is one small change I will make, bu

Re: [h2] H2 trunk, fix Geometry

2013-08-19 Thread Thomas Mueller
Hi, I made a few changes: - Rename "getNoDimensions" to "getDimensionCount", because "getNoDimensions" is confusing for non-native English speaking people ("get no dimensions versus get yes dimensions" ?!) - Rename the overloaded method "isGeometry" to "isGeometryClass" to avoid confusion. I kno

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

2013-08-19 Thread Thomas Mueller
Hi, Please note it's not the *size* of an uncommitted transaction that is a problem. The problem is, once you have an uncommitted transaction (which could mean there is only one row changed in the uncommitted transaction), then the transaction log is not truncated starting from that point on. So t

Re: [h2] Sequence already exists during runscript

2013-08-19 Thread Thomas Mueller
Hi, I can't say why the entry appears multiple times, I'm sorry. I guess the easiest solution is to manually remove the duplicate entries, but make sure to keep the one with the highest start value. Regards, Thomas On Saturday, August 17, 2013, Matthew Lohbihler wrote: > I am trying to recover

Re: [h2] Performance degradation in version 1.3.172 and newer for some queries.

2013-08-16 Thread Thomas Mueller
Hi, Thanks a lot for reporting the problem and analyzing the root cause! I just found out the problem also exists without using MVCC. Maybe there is an additional problem when using MVCC, I will need to check. But I think it is related to the change in version 1.3.172, "Issue 389: When there is a

Re: [h2] Re: In-Memory Database and TCP Server Queries

2013-08-16 Thread Thomas Mueller
Hi, In Eclipse, you can decide whether you want to suspend all thread or only the current thread. I guess with other IDEs it's the same. Possibly easier is to add the following line in your code, at the place where you want to look at the database: org.h2.tools.Server.startWebServer(con

Re: [h2] In-Memory Database and TCP Server Queries

2013-08-15 Thread Thomas Mueller
Hi, The is not the correct way to use the server. You can't supply the database URL when starting the server. Try: server = Server.createTcpServer().start(); and then connect to the database using the database URL "jdbc:h2:tcp://localhost/mem:test_mem". Regards, Thomas On Thu, Aug 15, 2013 a

Re: [h2] Performance degradation in version 1.3.172 and newer for some queries.

2013-08-15 Thread Thomas Mueller
Hi, Hm, I don't know what it could be. Could you add "analyze" before runnning the query (to ensure the statistics are updated), and then also run "explain select..." and "explain analyze select..." against version 1.3.171 and 1.3.173 and then post the result? Regards, Thomas On Thu, Aug 15, 2

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

2013-08-14 Thread Thomas Mueller
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 long). Regards, Thomas On Wed, Aug 14, 2013 at 6:16 PM, davide.c

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

2013-08-14 Thread Thomas Mueller
stream data 33%, 80174 page(s) > > It seems that the rows number of the huge db is nearly 5 times the shrunk > one. OTOH on a raw check (comparing the number of rows for the bigger > tables) it seems that the shrunk db contains the same data. > > Would it be compatible with a s

Re: [h2] H2 Environment Variable resolver

2013-08-13 Thread Thomas Mueller
Hi, I'm sorry but I would rather let it be the responsibility of the client to use the right database URL. H2 already supports various mechanisms (the baseDir option, relative, absolute, relative to the user home directory). I fear that adding yet another mechanism would only add complexity, and t

[h2] Re: Bug with subselects in a group by query when the subselect joins on a indexed column

2013-08-13 Thread Thomas Mueller
Hi, This should be fixed now. In the trunk currently, tomorrow it should be in the "Latest Automated Build (not released)<http://www.h2database.com/automated/h2-latest.jar> ". Regards, Thomas On Wed, May 29, 2013 at 7:36 PM, Thomas Mueller < thomas.tom.muel...@gmail.com>

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

2013-08-13 Thread Thomas Mueller
Hi, How large is the database exactly, and how does it grow exactly? Are you completely sure it doesn't stop growing? If yes, could you kill the process while the database is about 10 times as big as it should be, and then run the recovery tool, and post the statistics part of the the output? And

Re: [h2] Re: Table not found

2013-08-12 Thread Thomas Mueller
Hi, "Table not found" usually means that you are using an empty database. You are using an in-memory database. I suggest to try with a persistent database first, and if that works, see the documentation about in-memory databases. Regards, Thomas On Tue, Aug 13, 2013 at 1:42 AM, wrote: > Sti

[h2] Re: Postgres Functions in H2

2013-08-12 Thread Thomas Mueller
Hi, > ERROR: syntax error at or near "SELECT" This error message is from PostgreSQL, not H2. You need to ask at the PostgreSQL group. Regards, Thomas On Friday, April 12, 2013, wrote: > When I try that sample (and other variations) it complains about having > the select in the check (specifi

Re: [h2] Memory leak in using H2 ValueTimestamp object

2013-08-12 Thread Thomas Mueller
Hi, > The ValueTimestamp object goes from 978 to 1022 Well, I wouldn't call 1022 entries and 32 KB a "leak". It's the value cache, which is 1024 elements by default. There is a separate cache for ValueInt and ValueLong. See also http://h2database.com/javadoc/org/h2/constant/SysProperties.html?hi

Re: [h2] JDBC + Query Cache + DB Structure Change that invalidates query

2013-08-12 Thread Thomas Mueller
Hi, There is Database.getModificationMetaId(), which should return a different value whenever there was a change in the metadata. Maybe this could be used to ensure the cache statement can / cannot be re-used. Regards, Thomas On Mon, Aug 12, 2013 at 11:00 AM, Noel Grandin wrote: > > I was on

[h2] Random slow query

2013-08-12 Thread Thomas Mueller
; --- > MySQLDB... 0:14:36.311 (876311 ms) > HSQLDB... 0:07:09.021 (429021 ms) > H2DB... 0:53:57.432 (3237432 ms) > --- > MySQLDB... 0:11:34.360 (694360 ms) > HSQLDB... 0:07:16.572 (436572 ms) > H2DB... 0:25:06.446 (1506446 ms) > --- > MySQLDB... 0:11:10.191 (670191 ms) >

<    9   10   11   12   13   14   15   16   17   18   >