Syncope
  1. Syncope
  2. SYNCOPE-232

"Connection is read-only" during initialization

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2-incubating, 1.0.3-incubating
    • Fix Version/s: 1.0.4, 1.1.0
    • Component/s: core
    • Labels:
      None
    • Environment:
      MySQL

      Description

      During initialization, when MySQL is used, a set of exceptions are thrown like as:

      ...
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Connection is read-only. Queries leading to data modification are not allowed

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        15s 1 Francesco Chicchiriccò 02/Nov/12 17:04
        Resolved Resolved Reopened Reopened
        2d 22h 35m 1 Colm O hEigeartaigh 05/Nov/12 15:47
        Reopened Reopened In Progress In Progress
        19h 18m 1 Francesco Chicchiriccò 06/Nov/12 11:05
        In Progress In Progress Resolved Resolved
        11m 8s 2 Francesco Chicchiriccò 06/Nov/12 11:09
        Resolved Resolved Closed Closed
        33d 22h 46m 1 Francesco Chicchiriccò 10/Dec/12 09:56
        Francesco Chicchiriccò made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Francesco Chicchiriccò added a comment -

        Bulk closing for 1.0.4

        Show
        Francesco Chicchiriccò added a comment - Bulk closing for 1.0.4
        Hide
        Colm O hEigeartaigh added a comment -

        Excellent thanks, it's working now!

        Colm.

        Show
        Colm O hEigeartaigh added a comment - Excellent thanks, it's working now! Colm.
        Hide
        Hudson added a comment -

        Integrated in Syncope-1_0_X #54 (See https://builds.apache.org/job/Syncope-1_0_X/54/)
        SYNCOPE-232 Reverting previously applied patch + changing the Spring datasource definition so that JNDI datasource - if provided doesn't get mangled by Spring (Revision 1406094)

        Result = SUCCESS
        ilgrosso :
        Files :

        • /incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
        • /incubator/syncope/branches/1_0_X/core/src/main/resources/persistenceContext.xml
        Show
        Hudson added a comment - Integrated in Syncope-1_0_X #54 (See https://builds.apache.org/job/Syncope-1_0_X/54/ ) SYNCOPE-232 Reverting previously applied patch + changing the Spring datasource definition so that JNDI datasource - if provided doesn't get mangled by Spring (Revision 1406094) Result = SUCCESS ilgrosso : Files : /incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java /incubator/syncope/branches/1_0_X/core/src/main/resources/persistenceContext.xml
        Francesco Chicchiriccò made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Show
        Francesco Chicchiriccò added a comment - http://svn.apache.org/viewvc?rev=1406094&view=rev
        Hide
        Francesco Chicchiriccò added a comment - - edited

        Colm, your suspicion was right: I've changed some time ago the way how Spring manages DataSource, and the bug - actually a misconfiguration - was there.

        I've just committed the fix: for any 1.0.2 / 1.0.3 user, you can still have the fix by downloading [1] in your project's core/src/main/resources directory.

        Regards.

        [1] https://svn.apache.org/repos/asf/incubator/syncope/branches/1_0_X/core/src/main/resources/persistenceContext.xml

        Show
        Francesco Chicchiriccò added a comment - - edited Colm, your suspicion was right: I've changed some time ago the way how Spring manages DataSource, and the bug - actually a misconfiguration - was there. I've just committed the fix: for any 1.0.2 / 1.0.3 user, you can still have the fix by downloading [1] in your project's core/src/main/resources directory. Regards. [1] https://svn.apache.org/repos/asf/incubator/syncope/branches/1_0_X/core/src/main/resources/persistenceContext.xml
        Francesco Chicchiriccò made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        Hide
        Colm O hEigeartaigh added a comment -

        Hi Francesco,

        Thanks for looking in to this. I'm still getting the error. The difference between the steps you have outlined and my deployment scenario, is that I am using a datasource. Could you try with this to see if you can replicate the error?

        On Tomcat, I'm adding the following to $CATALINA_HOME/conf/context.xml:

        <Resource name="jdbc/syncopeDataSource" auth="Container" type="javax.sql.DataSource"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true"
        testOnBorrow="true" testOnReturn="true" validationQuery="SELECT 1" validationInterval="30000"
        maxActive="50" minIdle="2" maxWait="10000" initialSize="2" removeAbandonedTimeout="20000"
        removeAbandoned="true" logAbandoned="true" suspectTimeout="20000"
        timeBetweenEvictionRunsMillis="5000" minEvictableIdleTimeMillis="5000"
        jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
        username="syncope_user" password="syncope_pass" driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8"/>

        <Manager pathname="" /> is uncommented and the "resource-ref" section in 'core/src/main/webapp/WEB-INF/web.xml' is uncommented.

        Thanks,

        Colm.

        Show
        Colm O hEigeartaigh added a comment - Hi Francesco, Thanks for looking in to this. I'm still getting the error. The difference between the steps you have outlined and my deployment scenario, is that I am using a datasource. Could you try with this to see if you can replicate the error? On Tomcat, I'm adding the following to $CATALINA_HOME/conf/context.xml: <Resource name="jdbc/syncopeDataSource" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true" testOnBorrow="true" testOnReturn="true" validationQuery="SELECT 1" validationInterval="30000" maxActive="50" minIdle="2" maxWait="10000" initialSize="2" removeAbandonedTimeout="20000" removeAbandoned="true" logAbandoned="true" suspectTimeout="20000" timeBetweenEvictionRunsMillis="5000" minEvictableIdleTimeMillis="5000" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" username="syncope_user" password="syncope_pass" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8"/> <Manager pathname="" /> is uncommented and the "resource-ref" section in 'core/src/main/webapp/WEB-INF/web.xml' is uncommented. Thanks, Colm.
        Hide
        Francesco Chicchiriccò added a comment -

        Colm,
        I am not able to reproduce this issue; here it follows what I did.

        1. "mvn -P all clean install" on branch 1_0_X sources - this because the hotel connection isn't particularly good, but I don't think is relevant

        2. "mvn archetype:generate -DarchetypeGroupId=org.apache.syncope -DarchetypeArtifactId=syncope-archetype -DarchetypeRepository=file:///home/ilgrosso/.m2/repository -DarchetypeVersion=1.0.4-incubating-SNAPSHOT" - for creating a sample project

        3. added MySQL JDBC connector in core/pom.xml:
        <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.21</version>
        </dependency>

        4. replaced core/src/main/resources/persistence.properties with [1]

        5. changed port from 9080 to 8080 in console/src/main/resources/configuration.properties

        6. "mvn clean package"

        7. deployed core/target/syncope.war and console/target/syncope-console.war to Tomcat

        8. started Tomcat, logged in to admin console, then created a connector (CSV), a resource and a synchronization task (with schedule).

        No failures.

        I've also repeated all the steps above using PostgreSQL; same results.

        Colm, could you please try to create a fresh environment like in the above steps? I suspect it might be something relating to upgrading from one version to another.

        [1] https://svn.apache.org/repos/asf/incubator/syncope/branches/1_0_X/core/src/test/resources/mysql/persistence.properties

        Show
        Francesco Chicchiriccò added a comment - Colm, I am not able to reproduce this issue; here it follows what I did. 1. "mvn -P all clean install" on branch 1_0_X sources - this because the hotel connection isn't particularly good, but I don't think is relevant 2. "mvn archetype:generate -DarchetypeGroupId=org.apache.syncope -DarchetypeArtifactId=syncope-archetype -DarchetypeRepository= file:///home/ilgrosso/.m2/repository -DarchetypeVersion=1.0.4-incubating-SNAPSHOT" - for creating a sample project 3. added MySQL JDBC connector in core/pom.xml: <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.21</version> </dependency> 4. replaced core/src/main/resources/persistence.properties with [1] 5. changed port from 9080 to 8080 in console/src/main/resources/configuration.properties 6. "mvn clean package" 7. deployed core/target/syncope.war and console/target/syncope-console.war to Tomcat 8. started Tomcat, logged in to admin console, then created a connector (CSV), a resource and a synchronization task (with schedule). No failures. I've also repeated all the steps above using PostgreSQL; same results. Colm, could you please try to create a fresh environment like in the above steps? I suspect it might be something relating to upgrading from one version to another. [1] https://svn.apache.org/repos/asf/incubator/syncope/branches/1_0_X/core/src/test/resources/mysql/persistence.properties
        Hide
        Colm O hEigeartaigh added a comment - - edited

        This bug still exists on the 1_0_X branch. My setup is a deployment in Apache Tomcat with a MySQL DataSource. If I try to create a Synchronization task, I get a "read-only" error.

        org.quartz.JobPersistenceException: Couldn't remove trigger: Connection is read-only. Queries leading to data modification are not allowed

        {prepstmnt 1004087995 DELETE FROM QRTZ_SIMPLE_TRIGGERS WHERE TRIGGER_NAME = ? AND TRIGGER_GROUP = ?}

        [code=0, state=S1009]

        ...

        at org.quartz.impl.StdScheduler.unscheduleJob(StdScheduler.java:290) ~[quartz-1.8.6.jar:na]
        at org.apache.syncope.core.init.JobInstanceLoader.unregisterJob(JobInstanceLoader.java:196) [JobInstanceLoader.class:na]
        at org.apache.syncope.core.init.JobInstanceLoader.registerJob(JobInstanceLoader.java:135) [JobInstanceLoader.class:na]
        at org.apache.syncope.core.init.JobInstanceLoader.registerJob(JobInstanceLoader.java:182) [JobInstanceLoader.class:na]

        Colm.

        Show
        Colm O hEigeartaigh added a comment - - edited This bug still exists on the 1_0_X branch. My setup is a deployment in Apache Tomcat with a MySQL DataSource. If I try to create a Synchronization task, I get a "read-only" error. org.quartz.JobPersistenceException: Couldn't remove trigger: Connection is read-only. Queries leading to data modification are not allowed {prepstmnt 1004087995 DELETE FROM QRTZ_SIMPLE_TRIGGERS WHERE TRIGGER_NAME = ? AND TRIGGER_GROUP = ?} [code=0, state=S1009] ... at org.quartz.impl.StdScheduler.unscheduleJob(StdScheduler.java:290) ~ [quartz-1.8.6.jar:na] at org.apache.syncope.core.init.JobInstanceLoader.unregisterJob(JobInstanceLoader.java:196) [JobInstanceLoader.class:na] at org.apache.syncope.core.init.JobInstanceLoader.registerJob(JobInstanceLoader.java:135) [JobInstanceLoader.class:na] at org.apache.syncope.core.init.JobInstanceLoader.registerJob(JobInstanceLoader.java:182) [JobInstanceLoader.class:na] Colm.
        Colm O hEigeartaigh made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Hudson added a comment -

        Integrated in Syncope-linux-branches #50 (See https://builds.apache.org/job/Syncope-linux-branches/50/)
        SYNCOPE-232 Removed readonly transactional flag from JobInstanceLoader.load() (Revision 1405056)

        Result = SUCCESS
        ilgrosso :
        Files :

        • /incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
        Show
        Hudson added a comment - Integrated in Syncope-linux-branches #50 (See https://builds.apache.org/job/Syncope-linux-branches/50/ ) SYNCOPE-232 Removed readonly transactional flag from JobInstanceLoader.load() (Revision 1405056) Result = SUCCESS ilgrosso : Files : /incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
        Francesco Chicchiriccò made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Show
        Francesco Chicchiriccò added a comment - http://svn.apache.org/viewvc?rev=1405056&view=rev
        Francesco Chicchiriccò made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Francesco Chicchiriccò made changes -
        Field Original Value New Value
        Assignee Francesco Chicchiriccò [ ilgrosso ]
        Francesco Chicchiriccò created issue -

          People

          • Assignee:
            Francesco Chicchiriccò
            Reporter:
            Francesco Chicchiriccò
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development