Hi guys,

I have exactly the same issue as Rami :-(

The application gets its connections from a pooled datasource (Apache
DBCP).

The datasource is configured as followed through Spring Framework.

        <bean id="dataSource"
class="org.apache.commons.dbcp.managed.BasicManagedDataSource"
                destroy-method="close">
                <property name="transactionManager" ref="transactionManager" />
                <property name="driverClassName" value="org.h2.Driver" />
                <property name="url" value="jdbc:h2:tcp://localhost:9092/
jbpm4;MVCC=TRUE" />
                <property name="username" value="admin" />
                <property name="password" value="admin" />
                <property name="maxActive" value="10" />
                <property name="maxIdle" value="10" />
                <property name="maxWait" value="60000" />
                <property name="validationQuery" value="select * from dual" />
                <property name="testOnBorrow" value="true" />
                <property name="testOnReturn" value="true" />
                <property name="testWhileIdle" value="true" />
                <property name="timeBetweenEvictionRunsMillis" value="60000" />
        </bean>

H2 is first started in Server Mode (localhost:9092).

Then as soon as I start my application I get the following exception:

org.h2.jdbc.JdbcSQLException: Cannot change the setting "MVCC" when
the database is already open; SQL statement:
SET MVCC TRUE [90133-147]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:
327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.command.dml.Set.update(Set.java:259)
        at org.h2.command.CommandContainer.update(CommandContainer.java:69)
        at org.h2.command.Command.executeUpdate(Command.java:201)
        at org.h2.engine.Engine.openSession(Engine.java:181)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:137)
        at org.h2.engine.Engine.createSession(Engine.java:120)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:124)
        at java.lang.Thread.run(Thread.java:662)
        at org.h2.engine.SessionRemote.done(SessionRemote.java:543)
        at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:109)
        at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:376)
        at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:
271)
        at org.h2.engine.SessionRemote.createSession(SessionRemote.java:265)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
        at org.h2.Driver.connect(Driver.java:72)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:
38)
        at
org.apache.commons.dbcp.managed.LocalXAConnectionFactory.createConnection(LocalXAConnectionFactory.java:
62)
        at
org.apache.commons.dbcp.managed.PoolableManagedConnectionFactory.makeObject(PoolableManagedConnectionFactory.java:
103)
        at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:
1556)
        at
org.apache.commons.dbcp.managed.BasicManagedDataSource.createPoolableConnectionFactory(BasicManagedDataSource.java:
196)
        ... 63 more

I'm currently using H2 1.2.147 with Sun JDK 1.6.0_23 on Windows XP SP3
32bit.

Any help to solve this issue ?

Regards,
Bertrand

On Dec 27 2010, 6:55 pm, Dario Fassi <[email protected]> wrote:
> Hi Rami,
>
> I don't understand why you can't setup your connection pool with a url that 
> has mvcc=true as part of it.
>
> regards,
> Dario
>
> El 20/12/10 19:22, Rami Ojares escribi :
>
> > In my startup script I first start the server and after that try to make a 
> > connection to the database
> > with an url that has mvcc=true.
> > This is never succesful however because mu applications have connection 
> > pools that always connect
> > to the database before my connection in the startup script.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to