Hi,

I found it a bit weird and investigated. In server mode, appending ";
autocommit=false" to the database URL is actually working, but the return
value of Connection.getAutoCommit() is wrong (until you execute the first
statement I believe). So, is a bug, and it will be fixed in the next
version.

But, I don't recommend using this setting. Why don't you use
Connection.setAutoCommit(false) instead? All databases support that.

Regards,
Thomas

On Sunday, March 9, 2014, Noel Grandin <noelgran...@gmail.com> wrote:

> It's not supported in server mode.
>
> On Thursday, 6 March 2014, Akshay Mehta 
> <mehta.aks...@gmail.com<javascript:_e(%7B%7D,'cvml','mehta.aks...@gmail.com');>>
> wrote:
>
>> Hi,
>>
>> I have an application which starts a TCP Server using the Server class.
>> Once the server is started the application then tries to establish the
>> connection (the database might not exists) using
>>
>> Server h2server = Server.createTcpServer(new String[]{"-tcpAllowOthers",
>> "-tcpPort", "9090", "-baseDir", "somepath"});
>> h2server = h2server.start();
>>
>> Connection con =
>> DriverManager.getConnection("jdbc:h2:tcp://localhost:9090/test;mvcc=true;autocommit=off");
>>
>> immediately after this when I issue the command
>> "con.getAutoCommit()" always returns a true.
>>
>> This also happens when using the connection string as follows and not
>> starting the server before hand:
>>
>>
>> DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test;mvcc=true;autocommit=off");
>>
>> While "con.getAutoCommit()" returns a false when using the connection
>> string with "jdbc:h2:file:".
>>
>> Am I doing something wrong or is the AutoCommit=off not supported in
>> Server Mode?
>>
>> regards
>> Akshay Mehta
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to h2-database+unsubscr...@googlegroups.com.
>> To post to this group, send email to h2-database@googlegroups.com.
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> h2-database+unsubscr...@googlegroups.com<javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to 
> h2-database@googlegroups.com<javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>
> .
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to