[Building Sakai] Transaction problem when copying site

Aaron Zeckoski aaronz at vt.edu
Wed Nov 11 02:00:45 PST 2009


This indicates that you have a configuration somewhere that is trying
to make the your connection readonly but something previous set this
as a writing transaction. If you have setup your own hibernate
connection to the database then this could occur because you are
trying to force the wrong state for the connection. That doesn't
appear to be the case from the stacktrace though. It looks to me like
gradebook is where this is failing (while trying to read the gradebook
object). I would look for a flag like this somewhere in the gradebook
service xml files and try to remove it (risky):
,readOnly
or possibly check for something setting the datasource connection
directly (less likely and also risky).

-AZ


On Wed, Nov 11, 2009 at 9:48 AM, Carl Nettelblad <cnettel at tele2.se> wrote:
> Hello,
>
>
>
> We are using the SiteService to copy sites programmatically from an external
> application. This is done within a common JTA transaction, as the
> information in the Sakai DB should ideally be kept consistent with our
> application-specific DB.
>
>
>
> This works fine for some sites with tools, but when we tested on a site
> using Samigo, we got the following stack trace:
>
> org.springframework.jdbc.UncategorizedSQLException: Hibernate operation:
> could not execute query; uncategorized SQLException for SQL [select
> gradebook0_.ID as ID310_, gradebook0_.VERSION as VERSION310_,
> gradebook0_.GRADEBOOK_UID as GR
>
> GRADE_MAPPING_ID as SELECTED5_310_, gradebook0_.ASSIGNMENTS_DISPLAYED as
> ASSIGNME6_310_, gradebook0_.COURSE_GRADE_DISPLAYED as COURSE7_310_,
> gradebook0_.ALL_ASSIGNMENTS_ENTERED as ALL8_310_, gradebook0_.LOCKED as
> LOCKED310_, gradebook
>
> RY11_310_ from GB_GRADEBOOK_T gradebook0_ where
> gradebook0_.GRADEBOOK_UID=?]; SQL state [null]; error code [0]; You cannot
> set read only during a managed transaction!; nested exception is
> java.sql.SQLException: You cannot set read onl
>
> Caused by:
>
> java.sql.SQLException: You cannot set read only during a managed
> transaction!
>
>         at
> org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcReadOnly(BaseWrapperManagedConnection.java:519)
>
>         at
> org.jboss.resource.adapter.jdbc.WrappedConnection.setReadOnly(WrappedConnection.java:88)
>
>         at
> org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:372)
>
>         at
> org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:338)
>
>         at $Proxy199.prepareStatement(Unknown Source)
>
>         at
> org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
>
>         at
> org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
>
>         at
> org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
>
>         at
> org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
>
>         at org.hibernate.loader.Loader.doQuery(Loader.java:673)
>
>         at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
>
>         at org.hibernate.loader.Loader.doList(Loader.java:2220)
>
>         at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
>
>         at org.hibernate.loader.Loader.list(Loader.java:2099)
>
>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
>
>         at
> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
>
>         at
> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
>
>         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
>
>         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
>
>         at
> org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849)
>
>         at
> org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
>
>         at
> org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
>
>         at
> org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:836)
>
>         at
> org.sakaiproject.component.gradebook.BaseHibernateManager.isGradebookDefined(BaseHibernateManager.java:98)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:597)
>
>         at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
>
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
>
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
>
>         at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
>
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
>
>         at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>
>         at $Proxy209.isGradebookDefined(Unknown Source)
>
>         at
> org.sakaiproject.tool.gradebook.facades.sakai2impl.GradebookEntityProducer.contextUpdated(GradebookEntityProducer.java:83)
>
>         at
> org.sakaiproject.site.impl.BaseSiteService.enableRelated(BaseSiteService.java:1875)
>
>         at
> org.sakaiproject.site.impl.BaseSiteService.doSave(BaseSiteService.java:890)
>
>         at
> org.sakaiproject.site.impl.BaseSiteService.save(BaseSiteService.java:807)
>
>
>
>
>
> This is somewhat surprising. I realize that this is an unsupported
> configuration, but any input would be welcome. The Sakai version used is
> 2.6.0, with the services running within the Catalina/Tomcat fork in JBoss.
>
>
>
> Regards,
>
> Carl Nettelblad
>
> Uppsala University
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"
>
>



-- 
Aaron Zeckoski (azeckoski (at) vt.edu)
Senior Research Engineer - CARET - University of Cambridge
https://twitter.com/azeckoski - http://www.linkedin.com/in/azeckoski
http://aaronz-sakai.blogspot.com/ - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list