I have a class Im trying to build out that has an DSLContext Autowired from
Spring with Spring's TransactionAwareDataSourceProxy, my current code looks
something along the lines of:
MyPoJo newPojo = new MyPoJo();
newPojo.setFeildOne(fieldOne);
newPojo.setFieldTwo(fieldTwo);
newPojo.setFieldThree(fieldThree);
MyRecord newRecord = create.newRecord(MY_TABLE, newPojo);
newRecord.insert();
It looks like the connection is for some reason being marked as read-only.
Even after being over explicit and annotating the method above with
@Transactional( readOnly = false ) I still get the same stack trace:
org.jooq.exception.DataAccessException: SQL [insert into
`Database`.`MyTable` (`field_one`, `field_two`, `field_three`) values (?,
?, ?)]; Connection is read-only. Queries leading to data modification are
not allowed
at org.jooq.impl.Utils.translate(Utils.java:1690)
at
org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:660)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:356)
at
org.jooq.impl.TableRecordImpl.storeInsert0(TableRecordImpl.java:177)
at org.jooq.impl.TableRecordImpl$1.operate(TableRecordImpl.java:143)
at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:128)
at
org.jooq.impl.TableRecordImpl.storeInsert(TableRecordImpl.java:139)
at org.jooq.impl.TableRecordImpl.insert(TableRecordImpl.java:132)
at org.jooq.impl.TableRecordImpl.insert(TableRecordImpl.java:127)
... [Redacted]
at
org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Connection is read-only. Queries leading
to data modification are not allowed
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1970)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922)
at
org.jooq.tools.jdbc.DefaultPreparedStatement.executeUpdate(DefaultPreparedStatement.java:88)
at org.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:349)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342)
... 18 more
After a couple of hours of searching for an answer to no avail, I've kind
of given up and Im assuming that I've missed something terribly wrong. If
anyone can offer up some advice as to what to look at next, I would greatly
appreciate it.
--
Tim
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.