// Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds1' defined in class path resource [spring.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
// Caused by: java.lang.NullPointerException
// at org.h2.jdbcx.JdbcXAConnection.addConnectionEventListener(JdbcXAConnection.java:80)
// at com.atomikos.jdbc.ExternalXAPooledConnectionImp.<init>(Unknown Source)
// at com.atomikos.jdbc.ExternalXAPooledConnectionImp.<init>(Unknown Source)
// at com.atomikos.jdbc.ExclusiveExternalXAPooledConnectionImp.<init>(Unknown Source)
// at com.atomikos.jdbc.XAConnectionFactory.getPooledConnection(Unknown Source)
// at com.atomikos.jdbc.ConnectionPool.<init>(Unknown Source)
// at com.atomikos.jdbc.JtaDataSourceImp.<init>(Unknown Source)
// at com.atomikos.jdbc.SimpleDataSourceBean.checkSetup(Unknown Source)
//
//
// After a little debugging I see that the connection in the JdbcXAConnection class is null.
//
// Is it a configuration issue, or is XA not fully implemented in H2?
//
// Thanks
//
// Marc
// It would be nice if the donation link opened a new window. I could not see where I was at in the address bar while filling out the form.
// support % operator (modulo)
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.h2.Driver -url jdbc:h2:test -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver com.mysql.jdbc.Driver -url jdbc:mysql://localhost/test -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.apache.derby.jdbc.EmbeddedDriver -url jdbc:derby:test3;create=true -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.postgresql.Driver -url jdbc:postgresql:jpox2 -user sa -password sa -script c:/temp/test.sql
@@ -56,7 +56,7 @@ public class TestHibernateClob {
conn.createStatement();
stat0.executeUpdate("drop table CLOB_ENTITY if exists");
stat0.getWarnings();
stat0.executeUpdate("create table CLOB_ENTITY (ID bigint not null, SER_DATA clob, CLOB_DATA clob, primary key (ID))");
stat0.executeUpdate("create table CLOB_ENTITY (ID bigint not null, DATA clob, CLOB_DATA clob, primary key (ID))");
stat0.getWarnings();
stat0.close();
conn.getWarnings();
...
...
@@ -75,7 +75,7 @@ public class TestHibernateClob {
prep0.close();
conn.getAutoCommit();
PreparedStatementprep1=
conn.prepareStatement("insert into CLOB_ENTITY (SER_DATA, CLOB_DATA, ID) values (?, ?, ?)");
conn.prepareStatement("insert into CLOB_ENTITY (DATA, CLOB_DATA, ID) values (?, ?, ?)");
prep1.setNull(1,2005);
StringBufferbuff=newStringBuffer(20000);
for(inti=0;i<10000;i++){
...
...
@@ -96,12 +96,12 @@ public class TestHibernateClob {
conn.getAutoCommit();
conn.getAutoCommit();
PreparedStatementprep2=
conn.prepareStatement("select clobholdin0_.ID as ID0_0_, clobholdin0_.SER_DATA as SER2_0_0_, clobholdin0_.CLOB_DATA as CLOB3_0_0_ from CLOB_ENTITY clobholdin0_ where clobholdin0_.ID=?");
conn.prepareStatement("select c_.ID as ID0_0_, c_.DATA as S2, c_.CLOB_DATA as CLOB3_0_0_ from CLOB_ENTITY c_ where c_.ID=?");
c0.createStatement().executeUpdate("create table australia (ID INTEGER NOT NULL, Name VARCHAR(100), FirstName VARCHAR(100), Points INTEGER, LicenseID INTEGER, PRIMARY KEY(ID))");
c0.createStatement().executeUpdate("create table australia (ID INTEGER NOT NULL, Name VARCHAR(100), firstName VARCHAR(100), Points INTEGER, LicenseID INTEGER, PRIMARY KEY(ID))");
c0.createStatement().executeUpdate("create table australia (ID INTEGER NOT NULL, Name VARCHAR(100), FirstName VARCHAR(100), Points INTEGER, LicenseID INTEGER, PRIMARY KEY(ID))");
c0.createStatement().executeUpdate("create table australia (ID INTEGER NOT NULL, Name VARCHAR(100), firstName VARCHAR(100), Points INTEGER, LicenseID INTEGER, PRIMARY KEY(ID))");
@@ -192,7 +192,7 @@ public class TestLob extends TestBase {
conn0.createStatement();
stat0.executeUpdate("drop table CLOB_ENTITY if exists");
stat0.getWarnings();
stat0.executeUpdate("create table CLOB_ENTITY (ID bigint not null, SER_DATA clob, CLOB_DATA clob, primary key (ID))");
stat0.executeUpdate("create table CLOB_ENTITY (ID bigint not null, DATA clob, CLOB_DATA clob, primary key (ID))");
stat0.getWarnings();
stat0.close();
conn0.getWarnings();
...
...
@@ -211,7 +211,7 @@ public class TestLob extends TestBase {
prep0.close();
conn0.getAutoCommit();
PreparedStatementprep1=
conn0.prepareStatement("insert into CLOB_ENTITY (SER_DATA, CLOB_DATA, ID) values (?, ?, ?)");
conn0.prepareStatement("insert into CLOB_ENTITY (DATA, CLOB_DATA, ID) values (?, ?, ?)");
prep1.setNull(1,2005);
StringBufferbuff=newStringBuffer(10000);
for(inti=0;i<10000;i++){
...
...
@@ -232,12 +232,12 @@ public class TestLob extends TestBase {
conn0.getAutoCommit();
conn0.getAutoCommit();
PreparedStatementprep2=
conn0.prepareStatement("select clobholdin0_.ID as ID0_0_, clobholdin0_.SER_DATA as SER2_0_0_, clobholdin0_.CLOB_DATA as CLOB3_0_0_ from CLOB_ENTITY clobholdin0_ where clobholdin0_.ID=?");
conn0.prepareStatement("select c_.ID as ID0_0_, c_.DATA as S_, c_.CLOB_DATA as CLOB3_0_0_ from CLOB_ENTITY c_ where c_.ID=?");
// stat.execute("INSERT INTO TEST VALUES("+i+", 'Helloasdfaldsjflajdflajdslfaajlskdfkjasdfadsfasdfadsfadfsalksdjflasjflajsdlkfjaksdjflkskd"+i+"')");
// stat.execute("INSERT INTO TEST VALUES("+i+", 'abchelloasdfaldsjflajdflajdslfaajlskdfkjasdfadsfasdfadsfadfsalksdjflasjflajsdlkfjaksdjflkskd"+i+"')");
// ResultSet rs = stat.executeQuery("SELECT * FROM TEST WHERE ID="+i);