Salut à tous !
Dans mon appli, je me prend une exception du style
Bon, très bien. Cependant elle se produit sur un appel comme ceci :Citation:
Job DEFAULT.scanJob threw a JobExecutionException:
[exec] org.quartz.JobExecutionException: Could not invoke method 'scanMOPDepository' on target object [fr.a.e.ds.service.system.SystemServiceImpl@c8fa1e] [See nested exception: org.springframework.jdbc.UncategorizedSQLException: (HibernateTemplate): encountered SQLException [Connection is read-only. Queries leading to data modification are not allowed]; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed]
[exec] at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:174)
[exec] at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
[exec] at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
[exec] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
[exec] * Nested Exception (Underlying Cause) ---------------
[exec] org.springframework.jdbc.UncategorizedSQLException: (HibernateTemplate): encountered SQLException [Connection is read-only. Queries leading to data modification are not allowed]; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
[exec] java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
[exec] at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:537)
[exec] at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:701)
[exec] at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
[exec] at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:126)
[exec] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2421)
[exec] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2372)
[exec] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
[exec] at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
[exec] at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:464)
[exec] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:376)
[exec] at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:242)
[exec] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
Avec dans appCxt.xml, pour myBean :Code:
1
2 _myBean.getSomeAttributes(some parameters)
- Pourquoi il me dit que j'ai pas le droit de faire des modifs alors que je veux juste faire un get?Citation:
<bean id="transactionManager"
class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="myBean"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="preInterceptors">
<ref bean = "performanceInterceptor"/>
</property>
<property name="transactionAttributes">
<props>
<!-- General rule for read-only methods -->
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
- Peut être il reste des choses non commitées?
Si vous avez une explication, je suis preneur :)