I am using jboss 7.1.1 and its embedded h2-database:
{code}
<datasource jta="true" jndi-name="java:/ds-mydb" pool-name="pool-mydb" use-java-context="true" use-ccm="true">
<connection-url>jdbc:h2:~/h2/mydb</connection-url>
<driver>h2</driver>
</datasource>
{code}
In my scenario, I do not need access of database by another process other than jboss server, hence I want to use the embedded mode.
Everything works fine but I am wondering about 3 things:
1. Does jbossAS is able to make use of database connection pooling with embedded databases in generally? Or do I have to setup a database accessed by server (jdbc:h2:tcp://localhost/~/h2/mydb) ?
2. Should I use ;DB_CLOSE_DELAY=-1 to eliminate the need to reopen the connection again by jboss as?
3. Can I make use of Database File Locking "Socket" (jdbc:h2:~/h2/mydb;FILE_LOCK=SOCKET) to avoid the watchdog-thread of the database or does it conflicts with the database connection pooling of jboss?
By the way, I figured out, that using server mode is not considerably faster than using embedded mode. I guess, because jbossAs reopens the "database in embedded mode" everytime without making use of connection pool. But I am unsure.