Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL_EXCEPTION: ORA-00917: missing comma while inserting to jv_snapshot #887

Closed
Arun8460 opened this issue Sep 25, 2019 · 5 comments
Closed

SQL_EXCEPTION: ORA-00917: missing comma while inserting to jv_snapshot #887

Arun8460 opened this issue Sep 25, 2019 · 5 comments

Comments

@Arun8460
Copy link

@Arun8460 Arun8460 commented Sep 25, 2019

Getting the following issue while inserting to jv_snapshot. Using Oracle 12c DB. Same is working in H2.
Javers Version: 5.7.4

org.javers.common.exception.JaversException: SQL_EXCEPTION: ORA-00917: missing comma

while executing sql: INSERT INTO jv_snapshot ( type, global_id_fk, commit_fk, version, state, changed_properties, managed_type, snapshot_pk ) VALUES ( ?,?,?,?,?,?,?,jv_snapshot_pk_seq.nextval from dual * 100 )
at org.javers.repository.sql.session.PreparedStatementExecutor.wrapExceptionAndCall(PreparedStatementExecutor.java:120)
at org.javers.repository.sql.session.PreparedStatementExecutor.runVoidSql(PreparedStatementExecutor.java:110)
at org.javers.repository.sql.session.PreparedStatementExecutor.execute(PreparedStatementExecutor.java:39)
at org.javers.repository.sql.session.Session.execute(Session.java:105)
at org.javers.repository.sql.session.Session.executeInsert(Session.java:75)
at org.javers.repository.sql.session.InsertBuilder.execute(InsertBuilder.java:58)
at org.javers.repository.sql.repositories.CdoSnapshotRepository.save(CdoSnapshotRepository.java:37)
at org.javers.repository.sql.JaversSqlRepository.persist(JaversSqlRepository.java:87)
at org.javers.repository.api.JaversExtendedRepository.persist(JaversExtendedRepository.java:154)
at org.javers.core.JaversCore.persist(JaversCore.java:104)
at org.javers.core.JaversCore.commit(JaversCore.java:85)
at org.javers.spring.jpa.JaversTransactionalDecorator.commit(JaversTransactionalDecorator.java:82)
at org.javers.spring.jpa.JaversTransactionalDecorator$$FastClassBySpringCGLIB$$acb40bd0.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at org.javers.spring.jpa.JaversTransactionalDecorator$$EnhancerBySpringCGLIB$$3e881dea.commit()
at org.javers.spring.auditable.aspect.JaversCommitAdvice.commitObject(JaversCommitAdvice.java:42)
at org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.lambda$onSave$0(AbstractSpringAuditableRepositoryAspect.java:31)
at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
at org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.lambda$onSave$1(AbstractSpringAuditableRepositoryAspect.java:31)
at java.util.Optional.ifPresent(Optional.java:159)
at org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.onSave(AbstractSpringAuditableRepositoryAspect.java:30)
at org.javers.spring.auditable.aspect.springdatajpa.JaversSpringDataJpaAuditableRepositoryAspect.onSaveAndFlushExecuted(JaversSpringDataJpaAuditableRepositoryAspect.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:626)
at org.springframework.aop.aspectj.AspectJAfterReturningAdvice.afterReturning(AspectJAfterReturningAdvice.java:66)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy275.saveAndFlush(Unknown Source)

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 25, 2019

argh, this is caused by the Oracle 'dual' nonsense ..

@Arun8460
Copy link
Author

@Arun8460 Arun8460 commented Sep 25, 2019

yes, dual in the sql is causing the issue, jv_snapshot_pk_seq.nextval * 100 should work

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 25, 2019

right

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 25, 2019

bug introduced in 5.7.2

bartoszwalacik added a commit that referenced this issue Sep 27, 2019
added dockerized tests for Oracle
fixed SQL_EXCEPTION: ORA-00917: missing comma while inserting to jv_snapshot
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 28, 2019

Fixed in 5.7.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants