Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-2790

Split Rice datasource configuration for KNS datasources across client-side and server-side

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: Database, Development
    • Labels:
      None
    • Similar issues:
      KULRICE-12814Clean up datasource configuration
      KULRICE-332need to be able to configure multiple datasources
      KULRICE-7861Cannot define datasource on KimConfigurer
      KULRICE-12310Add dataSource property to CoreServiceConfigurer
      KULRICE-13431Implement a unit test that tests transactions across multiple datasources
      KULRICE-8156KRMSConfigurer needs the ability to specify a datasource
      KULRICE-1463The secure.* properties for workflowDocumentActions and workflowUtility are not configured on the server side
      KULRICE-2853Test that the BusinessObjectService can persist/query to more than one datasource
      KULRICE-8664Update KENConfigurer to have the ability to specify a different datasource
      KULRICE-5196Determine if Pessimistic locks need to move to the server as server-side remoted services
    • Rice Module:
      KNS

      Description

      Since we are now going to be accessing the system parameter and namespace tables on the standalone server, instead of the client application, we need to modify the KNS ojb configuration to allow for this.

      1) Add a new jdbc-connection-descriptor to ojb-repository-kns.xml, name the two jcd-alias as knsClientDataSource and knsServerDataSource
      2) Modify the KNSConfigurer to take a clientDataSource and serverDataSource properties. Similar to messageDataSource and registryDataSource on the KSBConfigurer
      3) Create two datasources in the KNSSpringBeans.xml file and get rid of the existing knsDataSource one (these 2 will replace that). See how messageDataSource and registryDataSource is configured in KSBSpringBeans.xml.
      4) Modify the knsOjbConfigurer spring bean to include our new jcdAliases
      5) Update platformAwareDao and platformAwareDaoJDBC in KNSSpringBeans to point to the knsClientDataSource

        Issue Links

          Activity

          Hide
          Eric Westfall added a comment -

          Additionally, this will include creating two separate ModuleConfigurations in the KNSSpringBeans.xml file, one for client side and one for server side.

          Also, for a list of the KNS tables that live server-side, see to bottom of the following confluence page:

          https://test.kuali.org/confluence/x/3QF-BQ

          Show
          Eric Westfall added a comment - Additionally, this will include creating two separate ModuleConfigurations in the KNSSpringBeans.xml file, one for client side and one for server side. Also, for a list of the KNS tables that live server-side, see to bottom of the following confluence page: https://test.kuali.org/confluence/x/3QF-BQ
          Hide
          Eric Westfall added a comment -

          One change, change the term "clientDataSource" to "applicationDataSource"

          Show
          Eric Westfall added a comment - One change, change the term "clientDataSource" to "applicationDataSource"
          Hide
          Eric Westfall added a comment -

          We also need to consider the JPA case here as well. This would result in two entity managers.

          Show
          Eric Westfall added a comment - We also need to consider the JPA case here as well. This would result in two entity managers.
          Hide
          Jeremy Hanson added a comment -

          I have pretty much all of the steps done in my local source code, but I have a couple of questions. Won't we need to create multiple module configurations (one for client datasource and one for the server datasource)?

          If we go this route, do I just create two knsModules, one for each module configuration? So instead of this:
          <bean id="knsApplicationModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" >
          <property name="moduleConfiguration" ref="knsApplicationModuleConfiguration"/>
          <property name="kualiModuleService" ref="kualiModuleService" />
          </bean>

          we'd have:
          <bean id="knsApplicationModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" >
          <property name="moduleConfiguration" ref="knsApplicationModuleConfiguration"/>
          <property name="kualiModuleService" ref="kualiModuleService" />
          </bean>

          <bean id="knsServerModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" >
          <property name="moduleConfiguration" ref="knsServerModuleConfiguration"/>
          <property name="kualiModuleService" ref="kualiModuleService" />
          </bean>

          Also, how would I go about setting each module configuration bean to point to be set to the correct tables?

          Show
          Jeremy Hanson added a comment - I have pretty much all of the steps done in my local source code, but I have a couple of questions. Won't we need to create multiple module configurations (one for client datasource and one for the server datasource)? If we go this route, do I just create two knsModules, one for each module configuration? So instead of this: <bean id="knsApplicationModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" > <property name="moduleConfiguration" ref="knsApplicationModuleConfiguration"/> <property name="kualiModuleService" ref="kualiModuleService" /> </bean> we'd have: <bean id="knsApplicationModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" > <property name="moduleConfiguration" ref="knsApplicationModuleConfiguration"/> <property name="kualiModuleService" ref="kualiModuleService" /> </bean> <bean id="knsServerModule" class="org.kuali.rice.kns.service.impl.ModuleServiceBase" > <property name="moduleConfiguration" ref="knsServerModuleConfiguration"/> <property name="kualiModuleService" ref="kualiModuleService" /> </bean> Also, how would I go about setting each module configuration bean to point to be set to the correct tables?
          Hide
          Eric Westfall added a comment -

          Yes, we would need to include two seperate module configurations.

          Yuck, just took a look at this and discovered that ModuleServiceBase.isResponsibleFor(Class businessObjectClass) is based on package name which won't work for splitting the KNS since all BOs are in the same package.

          So I think we are going to need special implementations of the 2 Module services for KNS which explicitly check each KNS BO to determine whether it should be client-side or server side.

          As far as setting up the knsServerModuleConfiguration you would want to include:

          Campus.xml
          CampusType.xml
          Country.xml
          County.xml
          Parameter.xml
          ParameterDetailType.xml
          ParameterNamespace.xml
          ParameterType.xml
          PostalCode.xml
          State.xml
          CampusMaintenanceDocument.xml
          CampusTypeMaintenanceDocument.xml
          CountryMaintenanceDocument.xml
          CountyMaintenanceDocument.xml
          ParameterDetailTypeMaintenanceDocument.xml
          ParameterMaintenanceDocument.xml
          ParameterNamespaceMaintenanceDocument.xml
          ParameterTypeMaintenanceDocument.xml
          PostalCodeMaintenanceDocument.xml
          StateMaintenanceDocument.xml

          All the state, country, etc. stuff is stuff that wasn't included in that original confluence document that i put in the previous comments.

          Show
          Eric Westfall added a comment - Yes, we would need to include two seperate module configurations. Yuck, just took a look at this and discovered that ModuleServiceBase.isResponsibleFor(Class businessObjectClass) is based on package name which won't work for splitting the KNS since all BOs are in the same package. So I think we are going to need special implementations of the 2 Module services for KNS which explicitly check each KNS BO to determine whether it should be client-side or server side. As far as setting up the knsServerModuleConfiguration you would want to include: Campus.xml CampusType.xml Country.xml County.xml Parameter.xml ParameterDetailType.xml ParameterNamespace.xml ParameterType.xml PostalCode.xml State.xml CampusMaintenanceDocument.xml CampusTypeMaintenanceDocument.xml CountryMaintenanceDocument.xml CountyMaintenanceDocument.xml ParameterDetailTypeMaintenanceDocument.xml ParameterMaintenanceDocument.xml ParameterNamespaceMaintenanceDocument.xml ParameterTypeMaintenanceDocument.xml PostalCodeMaintenanceDocument.xml StateMaintenanceDocument.xml All the state, country, etc. stuff is stuff that wasn't included in that original confluence document that i put in the previous comments.
          Hide
          Jeremy Hanson added a comment -

          From what I can tell, I have this working, except always has null values for the datasources and names. They are always null for the KSBConfigurer as well. This happens because these properties never seem to be set in the springbeans xml.

          Other than that, I currently have a KNSModuleService, that takes in a list of business objects from the spring beans file. KNSModuleService then overrides the isResponsibleFor method and checks to see if the class passed in is within the list of business object names. This all seems to work.

          Currently I have all of the business objects that exist in OJB-repository-kns.xml. I think this is all that is needed, but would there be any that this is missing?

          Show
          Jeremy Hanson added a comment - From what I can tell, I have this working, except always has null values for the datasources and names. They are always null for the KSBConfigurer as well. This happens because these properties never seem to be set in the springbeans xml. Other than that, I currently have a KNSModuleService, that takes in a list of business objects from the spring beans file. KNSModuleService then overrides the isResponsibleFor method and checks to see if the class passed in is within the list of business object names. This all seems to work. Currently I have all of the business objects that exist in OJB-repository-kns.xml. I think this is all that is needed, but would there be any that this is missing?
          Hide
          Jeremy Hanson added a comment -

          Committed changes. Still need to test multiple datasources at F2F next week.

          Show
          Jeremy Hanson added a comment - Committed changes. Still need to test multiple datasources at F2F next week.
          Hide
          Eric Westfall added a comment -

          Bulk change of all Rice 1.0 issues to closed after public release.

          Show
          Eric Westfall added a comment - Bulk change of all Rice 1.0 issues to closed after public release.

            People

            • Assignee:
              Jeremy Hanson
              Reporter:
              Eric Westfall
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Structure Helper Panel