Hi, I changed my MySQL database to H2 on a Ubuntu 12.04.1 LTS server. I noticed that H2 runs 6 to 8 times longer than MySQL during my applications login, where I perform numerous selects and one or two inserts statements. Do you know why this would be and is there anything I can change in my setup with H2 to improve its performance.
These are the scenarios I have tested : Java(TM) SE Runtime Environment (build 1.7.0_25-b15) h2-1.3.173.jar and h2-1.3.175.jar persistence.xml 1. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="IdentityAccessManagementPU" transaction-type="JTA"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>java/jdbc/idm/h2</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties/> </persistence-unit> </persistence> and 2. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="IdentityAccessManagementPU" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java/jdbc/idm/h2</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/> </properties> </persistence-unit> </persistence> 2 was using was using hibernate 4.3.4 Final Classname :org.h2.jdbcx.JdbcDataSource URL 1. jdbc:h2:tcp://localhost:9092///opt/IAM/data/IAM;CIPHER=AES;DB_CLOSE_ON_EXIT=FALSE and 2. jdbc:h2:tcp://localhost:9092///opt/IAM/data/IAM;CIPHER=AES I am starting the server with java -cp h2*.jar org.h2.tools.Server I have also used the H2 database in file mode. I used persistence.xml number one from above with URL : jdbc:h2:file:/opt/IAM/data/IAM;CIPHER=AES;AUTO_SERVER=TRUE;MVCC=TRUE;IFEXISTS=TRUE Let me know if you need anymore information. Thanks -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
