3 Replies Latest reply on Apr 20, 2006 8:15 AM by Naomi van Roosmalen

    Embeddable container: changing from Hypersonic to Postgres

    Naomi van Roosmalen Newbie

      First off, I'm pretty new to JBoss, so I apologize if this seems like a stupid question. I've been searching high and low for the answer to this problem but I cannot seem to find any info.

      I am trying to run JUnit tests using the embeddable container. I would like to switch from using Hypersonic to Postgres 8.1 for my unit tests. I've changed the driver class in embedded-jboss-beans.xml to org.postgresql.Driver, I've set up the proper connection URL, I've modified default.persistence.properties, I've set the hibernate.dialect to org.hibernate.dialect.PostgreSQLDialect, I've copied the postgresql-8.1-404-jdbc3.jar driver to the lib directory for the embeddable container and added it to the classpath in Eclipse. When I turn debugging on for the embeddable container and run my unit test, I get:

      DEBUG 12-04 09:43:52,626 (PersistenceManager.java:createSchema:264) -Could not create table with SQL: CREATE CACHED TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )
      org.postgresql.util.PSQLException: ERROR: syntax error at or near "CACHED"
      


      When I scroll further down to the rest of the debug output, it's as if my tables are being created in Hypersonic and the data is stored in there. Even though it mentions Postgres 8.1.3 in the output, I do not see it doing anything to my postgres database.

      Based on this I have the following questions:
      1. What am I missing in getting this to work?
      2. Is this even making sense for me to switch to Postgres for JUnit testing? Has anyone ever made this work?
      3. Is it supposed to be using Hypersonic for the JMS related tables, even if I change the database to Postgres?

      Any insights would be greatly appreciated.