hibernate - Any idea why H2 parser throws an exception at Oracle SQL statement "Syntax error in SQL statement "SELECT SUBJECT_SEQ.NEXTVAL FROM[*] DUAL"? -
i've following error when injecting entitymanager:
caused by: org.hibernate.exception.sqlgrammarexception: not prepare statement @ org.hibernate.exception.internal.sqlstateconversiondelegate.convert (sqlstateconversiondelegate.java:123) [hibernate-core-4.3.5.final.jar:4.3.5.final] @ org.hibernate.exception.internal.standardsqlexceptionconverter.convert (standardsqlexceptionconverter.java:49) [hibernate-core-4.3.5.final.jar:4.3.5.final] caused by: org.h2.jdbc.jdbcsqlexception: syntax error in sql statement "select subject_seq.nextval from[*] dual "; expected "identifier"; sql statement: select subject_seq.nextval dual [42001-173] @ org.h2.message.dbexception.getjdbcsqlexception(dbexception.java:331) @ org.h2.message.dbexception.get(dbexception.java:171) @ org.h2.message.dbexception.getsyntaxerror(dbexception.java:196) @ org.h2.command.parser.readcolumnidentifier(parser.java:2846) @ org.h2.command.parser.readtermobjectdot(parser.java:2401)
snippet of persistence.cfg:
<class>gov.dhs.obim.domain.bm.vendor</class> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.oracle10gdialect"/> <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.oracledriver"/> <property name="hibernate.connection.url" value="jdbc:oracle:thin:bm/password@localhost:1521:xe"/> <property name="hibernate.connection.password" value="password"/> <property name="hibernate.connection.username" value="obim"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> </properties> </persistence-unit> @transactionattribute(transactionattributetype.required) @stateless @webservice(targetnamespace = "http://docs.oasis- open.org/org.oasis.bias/ns/org.oasis.bias-1.0/", name = "bias_v1") public class biasv1impl implements biasv1 { @persistencecontext(unitname = "obim_bias2") entitymanager em; @override public enrollresponsepackage enroll(enrollrequest enrollrequest) throws biasfaultmessage { subject subject = new subject(); encounter encounter = new encounter(); subject.addencounter(encounter); assert(subject.getencounters().contains(encounter)); assert(encounter.getsubject() == subject); em.persist(subject); em.persist(encounter); return null; }
any idea why injection of entitymanager caused parser revalidate sql statement select subject_seq.nextval from[*] dual
?
this caused resulting error
org.hibernate.exception.sqlgrammarexception: not prepare statement @ org.hibernate.exception.internal.sqlstateconversiondelegate.convert (sqlstateconversiondelegate.java:123) [hibernate-core-4.3.5.final.jar:4.3.5.final] @ org.hibernate.exception.internal.standardsqlexceptionconverter.convert (standardsqlexceptionconverter.java:49) [hibernate-core-4.3.5.final.jar:4.3.5.final]
Comments
Post a Comment