Re: [h2] 1.4.191 much slower than 1.3.176 when bulk inserting

2016-04-28 Thread Joonas Pulakka
Please consider updating http://www.h2database.com/html/advanced.html#mvcc which says* The MVCC mode is enabled by default in version 1.4.x, with the default MVStore storage engine. * Best, Joonas maanantai 25. huhtikuuta 2016 9.40.39 UTC+3 Noel Grandin kirjoitti: > > Hi > > Aaaarh, you are us

Re: [h2] Fix of “Unique index or primary key violation” in H2 1.3 branch

2015-11-06 Thread Joonas Pulakka
There is an open issue about shutdown defrag corrupting db, https://github.com/h2database/h2database/issues/187 . I've had similar issue with non-split 1.4.190 DB. In my case the issue was, when opening DB that was shut down with shutdown defrag, Caused by: java.lang.ClassCastException: org.h2.

Re: [h2] Re: Why disabling auto-commit makes auto-reconnect throw exception?

2015-10-05 Thread Joonas Pulakka
code, with connection pool): > > repeat maxRetries > c = getConnection > c.execute "..." > c.execute "..." > c.commit > finally > c.close > > Regards, > Thomas > > > On Mon, Sep 28, 2015 at 10:08 AM, Joonas Pulakka >

[h2] Re: Why disabling auto-commit makes auto-reconnect throw exception?

2015-09-28 Thread Joonas Pulakka
happens to be handled the way it is handled currently, or is there a specific reason why is has to be handled that way? Best Regards, Joonas perjantai 25. syyskuuta 2015 13.37.15 UTC+3 Joonas Pulakka kirjoitti: > > From http://h2database.com/html/features.html#auto_mixed_mode and > ht

[h2] Why disabling auto-commit makes auto-reconnect throw exception?

2015-09-25 Thread Joonas Pulakka
>From http://h2database.com/html/features.html#auto_mixed_mode and http://h2database.com/html/features.html#auto_reconnect : - (Mixed mode) When the first connection is closed, the server stops. If other (remote) connections are still open, one of them will then start a server (auto-re

Re: [h2] Data corruption from repeatedly closing DB and re-opening it immediately

2015-03-25 Thread Joonas Pulakka
> blocks. This mechanism sometimes removes entries that are still used. I > have a fix now and will commit it to trunk. > > Regards, > Thomas > > > On Monday, March 23, 2015, Joonas Pulakka > wrote: > >> Hello, >> >> According to documentati

[h2] Data corruption from repeatedly closing DB and re-opening it immediately

2015-03-23 Thread Joonas Pulakka
Hello, According to documentation, *closing the last connection closes the database* (http://www.h2database.com/html/cheatSheet.html) and *when closing the database, the database is automatically compacted for up to 200 milliseconds *(http://www.h2database.com/html/features.html#compacting). I

Re: How do expressions work with OTHER datatype?

2010-10-29 Thread Joonas Pulakka
On Oct 28, 9:19 pm, Thomas Mueller wrote: > Hi, > > I think comparison of large binary data (BLOBs) should be discussed in > another topic. The new "lob in database" feature does now use a > checksum (hash code), but not a cryptographic one. If the checksum > matches, the content is compared (so t

Re: How do expressions work with OTHER datatype?

2010-10-24 Thread Joonas Pulakka
On Oct 22, 9:18 am, Thomas Mueller wrote: > Hi, > > > How do expressions work with OTHER datatype? > > It compares the byte array. See > alsohttp://h2database.com/html/datatypes.html#other_type > > > could it be added as feature request? > > Sure. It's not one of my priorities, but I can add a fe

Re: How do expressions work with OTHER datatype?

2010-10-15 Thread Joonas Pulakka
On Oct 14, 10:45 pm, Sergi Vladykin wrote: > But I agree that good user defined type system would be nice. So do I. What's good engineering practice to someone may seem like architecture astronautism to others. User defined types (as Rami described) would let both "sides" to be happy. For exampl

Re: How do expressions work with OTHER datatype?

2010-10-13 Thread Joonas Pulakka
lso comparable (implement comparable > interface)? > > Are you sure you can't decompose the data that your object houses into > proper types in database? > Or are you just wishing to dump a whole lot of information into database > quickly > without too much hassle? > >

How do expressions work with OTHER datatype?

2010-10-12 Thread Joonas Pulakka
When using the OTHER data type (serialized Java objects), do expressions (i.e. NAME='Hi') compare simply the serialized byte array (for exact equivalence), or is the (deserialized) object's equals method used? If equals is not currently used, could it be added as feature request? Thanks, Joonas -

Re: Empty user/password in 1.2.143

2010-09-20 Thread Joonas Pulakka
Hello, Ok, so it was just a bug. No problem then :-) Best Regards, Joonas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-datab...@googlegroups.com. To unsubscribe from this group, send email to h2-datab

Empty user/password in 1.2.143

2010-09-20 Thread Joonas Pulakka
Version 1.2.143 contained the following change: "If the user name and password are not set or empty, then the password is not hashed. To disable this behavior, set the system property h2.emptyPassword to false." As a consequence, setting the above mentioned system property seems to be required in

Re: Getting primary key of affected row after MERGE

2010-08-06 Thread Joonas Pulakka
s. I also don't know of a way to get the primary keys for a > simple update statement. Do other databases support such a feature? > > Regards, > Thomas > > > > On Thursday, August 5, 2010, Joonas Pulakka wrote: > > Ok, given that the "de facto" default star

Re: Getting primary key of affected row after MERGE

2010-08-05 Thread Joonas Pulakka
ah(id identity(7,2), val varchar(10)); > > insert into blah(val) values ('X') > insert into blah(val) values ('Y') > > select * from blah > > ... and the results will be: > > id     val > 7      X > 9      Y > > So as long as you didn&#

Getting primary key of affected row after MERGE

2010-08-05 Thread Joonas Pulakka
I need to get the primary key for the affected row after performing a MERGE statement, regardless of whether the row got inserted or updated. Is there a standard way to do that? Using the generated key from the statement was my first idea, but it doesn't work quite that way: http://www.h2database.

Re: New functions - HOWTO?

2010-04-21 Thread Joonas Pulakka
Patches are the recommended way to provide urgently needed features: http://www.h2database.com/html/build.html#providing_patches Best Regards, Joonas On 21 huhti, 00:35, feci wrote: > Hi, > > can you point me to page, where is written how to contribute, if I > want to create new functions? > I'

Re: synchronization on JdbcConnection

2010-04-21 Thread Joonas Pulakka
You can use ThreadLocal to store one Connection per thread. Something like: ThreadLocal connectionHolder = new ThreadLocal(); public Connection getConnection() { Connection c = connectionHolder.get(); if (c == null) { c = (get a new connection for this thread from DriverManager o

Re: synchronization on JdbcConnection

2010-04-20 Thread Joonas Pulakka
The JDBC spec doesn't require Connection to be thread-safe. But H2's Connection (http://www.h2database.com/javadoc/org/h2/jdbc/ JdbcConnection.html) is thread-safe. So yes, it's a kind of weird: as long as you use H2, you'll be fine, but since you're doing it "wrong", you'll lose interchangeability

get/setObject vs. get/setSpecificType

2010-03-30 Thread Joonas Pulakka
JDBC ResultSet offers getObject, getInt, getString etc. methods, and PreparedStatement has analogous setters. Since (according to http://www.h2database.com/html/datatypes.html) H2 is mapping primitives to their boxed counterparts anyway, do the type specific getters/setters have any (dis)advantages

Re: Client-side locking

2010-03-25 Thread Joonas Pulakka
On 25 maalis, 13:18, Sergi Vladykin wrote: > Yes, new connections will be rejected with error code 90135, so you > can write a loop to reconnect (may be after a little waiting) when you > get such an > exception.http://h2database.com/javadoc/org/h2/constant/ErrorCode.html?#c90135 Great that ther

Re: Client-side locking

2010-03-25 Thread Joonas Pulakka
On 25 maalis, 12:58, Sergi Vladykin wrote: > Hi, > > See http://h2database.com/html/grammar.html#set_exclusive Ah, excellent! Does just what I wanted. Just one question: what does it mean that "new connections are rejected"? If someone happens to call DriverManager.getConnection() on an unlucky m

Client-side locking

2010-03-25 Thread Joonas Pulakka
I want to acquire a lock on the whole database for a moment in order to perform a couple of operations in atomic fashion. That is, synchronized(???) { performACoupleOfOperationsAtomically(); } Which lock does H2 use internally to guard its state? I should obviously use the same lo

Re: Ambiguousity with triggers in multiple databases

2010-03-23 Thread Joonas Pulakka
On 22 maalis, 22:07, Thomas Mueller wrote: > Hi, > > > I think the key must be the Connection object > > It will create two distinct trigger objects. The init method of the > trigger will also contain the table name and so on. The unique > identifier of a database is usually the database URL by th

Ambiguousity with triggers in multiple databases

2010-03-20 Thread Joonas Pulakka
Hi, I wonder how I should approach this abmiguousity problem. Let's say that I have a trigger created into a database "A" like this: CREATE TRIGGER IF NOT EXISTS UsersModifiedTrigger AFTER INSERT, UPDATE, DELETE ON users FOR EACH ROW CALL "MyTrigger" Now, MyTrigger's fire() method gets calle

Is the Connection object thread-safe?

2010-03-19 Thread Joonas Pulakka
According to http://h2database.com/html/features.html#multiple_connections H2 is multithreading-safe. But does this also apply to the Connection object returned by DriverManager.getConnection("jdbc:h2:etc"), or should I create separate Connections for each thread in a multithreaded application? The

Re: Fault-tolerant embedded setup

2010-03-17 Thread Joonas Pulakka
Thanks, So my question is basically, what are the settings that give the best durability against power interrupts, given that sacrificing speed is OK in my application. I would assume that setting WRITE_DELAY=0, using CHECKPOINT SYNC all around, and using clustering (where practical) would be the

Re: RuntimeException while calling DriverManager.getConnection()

2010-03-17 Thread Joonas Pulakka
On Mar 17, 5:00 pm, Tim wrote: > While trying to open my H2 database recently, I've run into an > exception that hasn't been happening in the past.  The only thing I > can think of that has changed is that I moved the database from a > networked PC to my development PC, but I know that the connect

Fault-tolerant embedded setup

2010-03-14 Thread Joonas Pulakka
I need to make an embedded Java database as fault tolerant (power interrupt, JVM crash) as possible. Losing data from a few seconds before the crash is acceptable, but the rest of the database should not be corrupted in any way, and restarting the application should be easy. http://www.h2database.