Skip to content

Commit

Permalink
SAK-29550 Gradebook should use the global transaction manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ern committed Jun 20, 2015
1 parent abd678f commit 2491da2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 91 deletions.
61 changes: 0 additions & 61 deletions gradebook/app/sakai-tool/src/webapp/WEB-INF/spring-db.xml

This file was deleted.

4 changes: 1 addition & 3 deletions gradebook/app/sakai-tool/src/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
classpath:conf/sakaiComponents-applicationContext.xml,
classpath:conf/sakai-entitybroker-applicationContext.xml,
/WEB-INF/applicationContext.xml,
/WEB-INF/spring-db.xml,
/WEB-INF/spring-beans.xml,
/WEB-INF/spring-facades.xml,
/WEB-INF/spring-hib.xml
/WEB-INF/spring-facades.xml
</param-value>
</context-param>
<context-param>
Expand Down
35 changes: 33 additions & 2 deletions gradebook/app/ui/src/webapp/WEB-INF/spring-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,28 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<tx:annotation-driven transaction-manager="gradebookTransactionManager" />
<tx:annotation-driven transaction-manager="org.sakaiproject.springframework.orm.hibernate.GlobalTransactionManager" />

<!--
This Spring configuration file sets up the shared business logic of the application.
-->

<bean id="gradebookTxTemplate" lazy-init="true" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="org.sakaiproject.springframework.orm.hibernate.GlobalTransactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="is*">PROPAGATION_REQUIRED,readOnly,+org.sakaiproject.service.gradebook.shared.GradebookException</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly,+org.sakaiproject.service.gradebook.shared.GradebookException</prop>
<prop key="*">PROPAGATION_REQUIRED,+org.sakaiproject.service.gradebook.shared.GradebookException</prop>
</props>
</property>
</bean>

<!-- Gradebook Manager -->
<bean id="org_sakaiproject_tool_gradebook_business_GradebookManager" parent="gradebookTxTemplate">
<property name="target">
<bean class="org.sakaiproject.tool.gradebook.business.impl.GradebookCalculationImpl">
<property name="sessionFactory"><ref bean="gradebookSessionFactory"/></property>
<property name="sessionFactory"><ref bean="org.sakaiproject.springframework.orm.hibernate.GlobalSessionFactory"/></property>
<property name="sectionAwareness">
<ref bean="org.sakaiproject.section.api.SectionAwareness" />
</property>
Expand All @@ -36,6 +47,26 @@
</property>
</bean>

<bean id="gradebookHibernateMappings"
parent="org.sakaiproject.springframework.orm.hibernate.impl.AdditionalHibernateMappingsImpl">
<property name="mappingResources">
<list>
<value>org/sakaiproject/tool/gradebook/Gradebook.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradableObject.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradeRecord.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradingEvent.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradingScale.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradebookProperty.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/GradeMapping.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/Spreadsheet.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/Comment.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/Category.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/LetterGradePercenteMapping.hbm.xml</value>
<value>org/sakaiproject/tool/gradebook/Permission.hbm.xml</value>
</list>
</property>
</bean>

<!--
This bean is added because of cross-service transaction issues. There may
be a cleaner fix, but various exceptions were being thrown about multiple
Expand Down
25 changes: 0 additions & 25 deletions gradebook/app/ui/src/webapp/WEB-INF/spring-hib.xml

This file was deleted.

0 comments on commit 2491da2

Please sign in to comment.