0 Replies Latest reply on Nov 7, 2007 11:15 PM by caijc

    strange PersistenceException with EJB3:tables cannot be crea

    caijc

      jboss4.2,postgresql7.2,jdk1.6:
      in persistence.xml,I used:
      <jta-data-source>java:/PostgresDS</jta-data-source>
      org.hibernate.ejb.HibernatePersistence
      create-drop
      org.hibernate.dialect.PostgreSQLDialect

      Here I set "hibernate.hbm2ddl.auto" to "create-drop",and in JMX-console I also see this DSN:PostgresDS;
      and in postgres-ds.xml,it also seems no errors:
      <local-tx-datasource>
      <jndi-name>PostgresDS</jndi-name>
      <connection-url>jdbc:postgresql://127.0.0.1:5432/my</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>postgresql</user-name>
      111111
      but when I access the entities from JSP,exceptions are thrown:
      java.sql.BatchUpdateException: insert into tbl_Authors (birthday, levels, name) values (2007-11-08 +00:00:00, 5, wawa) failed
      LOOK:neither '2007-11-08 +00:00:00' nor 'wawa' are quoted with quotation marks,I think this is wrong.But why? it's generated by hibernate itself,not me!

      What's more,I login the postgresql database,and there is no tables created automatically either.Why this happens?