javax.persistence.TransactionRequiredException: no transaction is in progress

Stack Overflow | David Muñoz | 4 months ago
  1. 0

    Spring Batch JPA chunk processing with two databases issue

    Stack Overflow | 4 months ago | David Muñoz
    javax.persistence.TransactionRequiredException: no transaction is in progress
  2. 0

    Jeeves / Db query in config failed

    GitHub | 3 years ago | fxprunayre
    javax.persistence.TransactionRequiredException: no transaction is in progress
  3. 0

    entitymanager persist does not save to database

    Stack Overflow | 3 years ago | Dhorium
    javax.persistence.TransactionRequiredException: no transaction is in progress
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JpaRepository: No Transaction in progress

    Stack Overflow | 2 years ago | karthik
    javax.persistence.TransactionRequiredException: no transaction is in progress

    6 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.persistence.TransactionRequiredException

      no transaction is in progress

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.checkTransactionNeeded()
    2. org.hibernate.jpa
      AbstractEntityManagerImpl.flush
      1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.checkTransactionNeeded(AbstractEntityManagerImpl.java:1136)[hibernate-entitymanager-5.0.9.Final.jar:5.0.9.Final]
      2. org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1297)[hibernate-entitymanager-5.0.9.Final.jar:5.0.9.Final]
      2 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_71]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_71]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_71]
      4. java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_71]
      4 frames
    4. Spring ORM
      ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke
      1. org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:347)[spring-orm-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      1 frame
    5. com.sun.proxy
      $Proxy56.flush
      1. com.sun.proxy.$Proxy56.flush(Unknown Source)[na:na]
      1 frame
    6. Spring Batch Infrastructure
      JpaItemWriter.write
      1. org.springframework.batch.item.database.JpaItemWriter.write(JpaItemWriter.java:84)[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      1 frame
    7. Spring Batch Core
      TaskletStep$ChunkTransactionCallback.doInTransaction
      1. org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:175)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      2. org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:151)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      3. org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:274)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      4. org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:199)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      5. org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:75)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      6. org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      7. org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      7 frames
    8. Spring Tx
      TransactionTemplate.execute
      1. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      1 frame
    9. Spring Batch Core
      StepContextRepeatCallback.doInIteration
      1. org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      2. org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      2 frames
    10. Spring Batch Infrastructure
      RepeatTemplate.iterate
      1. org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374)[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      2. org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      3. org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      3 frames
    11. Spring Batch Core
      SimpleJobLauncher$1.run
      1. org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      2. org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:200)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      3. org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      4. org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      5. org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      6. org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      7. org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      8. org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      9. org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      10. org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      10 frames
    12. Spring Core
      SyncTaskExecutor.execute
      1. org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      1 frame
    13. Spring Batch Core
      SimpleJobLauncher.run
      1. org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      1 frame
    14. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_71]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_71]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_71]
      4. java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_71]
      4 frames
    15. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      3 frames
    16. Spring Batch Core
      SimpleBatchConfiguration$PassthruAdvice.invoke
      1. org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
      1 frame
    17. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      2 frames
    18. com.sun.proxy
      $Proxy63.run
      1. com.sun.proxy.$Proxy63.run(Unknown Source)[na:na]
      1 frame
    19. Spring Boot AutoConfigure
      JobLauncherCommandLineRunner.run
      1. org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.execute(JobLauncherCommandLineRunner.java:216)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      2. org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.executeLocalJobs(JobLauncherCommandLineRunner.java:233)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      3. org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.launchJobFromProperties(JobLauncherCommandLineRunner.java:125)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      4. org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.run(JobLauncherCommandLineRunner.java:119)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      4 frames
    20. Spring Boot
      SpringApplication.run
      1. org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      2. org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:782)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      3. org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:769)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      4. org.springframework.boot.SpringApplication.run(SpringApplication.java:314)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
      6 frames
    21. es.dmunozfer.example
      SpringBatchTwoDatabasesExampleApplication.main
      1. es.dmunozfer.example.batch.SpringBatchTwoDatabasesExampleApplication.main(SpringBatchTwoDatabasesExampleApplication.java:12)[classes/:na]
      1 frame