Hi,

I'm new to H2 and I have a Spring/Hibernate application that uses H2
database in server mode - I wanted the H2 to run in a different
process because it might consume a lot of memory (not because of
persistency - I don't care about the data once the application is
stopped.)
I'm using the latest version of H2.

I have a few questions that I couldn't find an answer to in the forums/
H2 documentation and I would really appreciate any help:

1. In order to start my application I have to first start the H2
server (using a .bat file or the start menu) and only then I can start
my application.
Is there a way to start the H2 database when my application starts?
(Either by using the Spring configuration files or any other way – I
don’t want to do it manually, and I don’t want to add additional Java
code to do that if there are alternatives)

2. Is there a way to initialize the database schema on my application
startup using a script?

3. When I delete several rows by using the command “delete from XXX
where a > 123” – does it always lock the entire table? Is there a way
to allow other threads to insert rows to this table?


My Spring configuration:
----------------------------------
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName"><value>org.h2.Driver</value></
property>
      <property name="url">
        <value>jdbc:h2:tcp://localhost/~/myAppDB</value>
      </property>
      <property name="username"><value>sa</value></property>
      <property name="password"><value></value></property>
</bean>

<bean id="org.h2.tools.Server" class="org.h2.tools.Server"
                factory-method="createTcpServer" init-method="start" destroy-
method="stop">
        <constructor-arg value="-tcp,-tcpAllowOthers,true,-tcpPort,8043" />
</bean>
---------------------------------

Thanks for the help

--~--~---------~--~----~------------~-------~--~----~
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