Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-958

Foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`))

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None

      Description

      While investigating FINERACT-922, and through FINERACT-858, I'm locally seeing the following errors when I run https://github.com/apache/fineract/pull/817 :

      53865 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 8
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 63 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 912128826 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 64 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 912128826 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 74 common frames omitted
      54035 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 12
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 61 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 2132436906 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 62 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 2132436906 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 72 common frames omitted
      56731 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 156
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 61 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 181190490 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 62 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 181190490 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 72 common frames omitted
      56805 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 160
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 61 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 1011073949 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 62 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 1011073949 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 72 common frames omitted
      56941 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 168
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 61 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 375913106 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 62 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 375913106 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 72 common frames omitted
      57029 [Scheduler1group1_Worker-1] ERROR o.a.f.p.s.s.SavingsSchedularServiceImpl - Failed to post interest for Savings with id 172
      org.springframework.orm.jpa.JpaSystemException: This operation failed for some instances.  See the nested exceptions array for details.; nested exception is <openjpa-3.1.1-r1440702 fatal general error> org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:408)
      	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:128)
      	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:528)
      	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
      	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy255.saveAndFlush(Unknown Source)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper.saveAndFlush(SavingsAccountRepositoryWrapper.java:123)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$FastClassBySpringCGLIB$$f36b704.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
      	at org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper$$EnhancerBySpringCGLIB$$ae560b0e.saveAndFlush(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl.postInterest(SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:566)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$FastClassBySpringCGLIB$$fa18015c.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
      	at org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformServiceJpaRepositoryImpl$$EnhancerBySpringCGLIB$$768f2116.postInterest(<generated>)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:74)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.openjpa.persistence.PersistenceException: This operation failed for some instances.  See the nested exceptions array for details.
      	at org.apache.openjpa.kernel.BrokerImpl.throwNestedExceptions(BrokerImpl.java:2669)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2347)
      	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
      	at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1161)
      	at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:775)
      	at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:314)
      	at com.sun.proxy.$Proxy120.flush(Unknown Source)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.flush(SimpleJpaRepository.java:601)
      	at org.springframework.data.jpa.repository.support.SimpleJpaRepository.saveAndFlush(SimpleJpaRepository.java:570)
      	at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371)
      	at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621)
      	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
      	... 34 common frames omitted
      Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
      	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
      	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
      	... 61 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 1239749368 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
      	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
      	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
      	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:554)
      	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:110)
      	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
      	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
      	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
      	... 62 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot add or update a child row: a foreign key constraint fails (`fineract_default`.`m_savings_account_transaction`, CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)) {prepstmnt 1239749368 INSERT INTO m_savings_account_transaction (amount, balance_end_date_derived, balance_number_of_days_derived, created_date, cumulative_balance_derived, transaction_date, is_loan_disbursement, is_manual, overdraft_amount_derived, release_id_of_hold_amount, is_reversed, running_balance_derived, transaction_type_enum, appuser_id, payment_detail_id, savings_account_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1452, state=23000]
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:58)
      	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1188)
      	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:308)
      	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1856)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:271)
      	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:121)
      	... 72 common frames omitted
      59136 [Scheduler1group1_Worker-1] ERROR org.quartz.core.JobRunShell - Job DEFAULT.Post Interest For SavingsJobDetail1 threw an unhandled Exception: 
      org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'postInterestForAccounts' on target class [class org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl] failed; nested exception is org.apache.fineract.infrastructure.jobs.exception.JobExecutionException: 6x failures occured here (details have been previously logged)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:276)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.apache.fineract.infrastructure.jobs.exception.JobExecutionException: 6x failures occured here (details have been previously logged)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:84)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	... 3 common frames omitted
      59136 [Scheduler1group1_Worker-1] ERROR org.quartz.core.ErrorLogger - Job (DEFAULT.Post Interest For SavingsJobDetail1 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception.
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'postInterestForAccounts' on target class [class org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl] failed; nested exception is org.apache.fineract.infrastructure.jobs.exception.JobExecutionException: 6x failures occured here (details have been previously logged)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:276)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	... 1 common frames omitted
      Caused by: org.apache.fineract.infrastructure.jobs.exception.JobExecutionException: 6x failures occured here (details have been previously logged)
      	at org.apache.fineract.portfolio.savings.service.SavingsSchedularServiceImpl.postInterestForAccounts(SavingsSchedularServiceImpl.java:84)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
      	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:267)
      	... 3 common frames omitted

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ptuomola Petri Tuomola
                Reporter:
                vorburger Michael Vorburger
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: