Remove generic DAO from shared
Description
duplicates
relates to
Activity

Aaron Zeckoski July 22, 2008 at 1:42 AM
Linked over to the new holding issue

Peter Knoop July 21, 2008 at 1:24 PM
Aaron, there are check-ins against this issue, so I'm re-closing this issue so it properly reflects the work that was done and committed (and already merged 2.5.x in fact!) If there are additional changes that need to be made then please use a new Jira to capture those. if this current set of changes is incomplete without further work, then please feel free to reopen it and back the changes out of 2.5.x until it is ready.

Aaron Zeckoski July 21, 2008 at 9:31 AM
Note that this is not an issue for EntityBroker and IU Feed tool because they are using the spring jdbc parts of generic-dao and those do not clash with placing the code in shared
The Feeds tool from UFP has already been migrated

Aaron Zeckoski July 21, 2008 at 9:24 AM
Reopening to make sure we have an issue for tracking this in general

David Horwitz July 14, 2008 at 7:50 AM
can we consider this for 2-5-x? very minor change but critical for those running the impl with other tools that use generic-dao
Generic-DAO should be placed into the impl rather than in shared for all projects that are using it. This is possible by simply moving the jar so that it is deployed in shared, moving the dao interface into the service impl, and changing the spring transaction bean over to the helper bean in gendao. I am happy to handle this conversion for those who are using it or I can explain how to do it in detail. -AZ
This should be done to reduce the dependencies in shared and to allow projects to deploy whatever version of gendao that they want.
Here are the steps to switch a project from using gendao in shared to packaging it in the component/webapp impl only in detail:
1) Move the DAO api from being deployed to shared/lib to being part of the impl (component if you have one, or webapp if you don't), in eclipse this is as easy as drag and drop, eclipse will handle the refactor
2) Update the gendao dependency to look like this in your impl pom.xml:
<dependency>
<groupId>org.sakaiproject</groupId>
<artifactId>generic-dao</artifactId>
<version>[0.9.8,1.0)</version>
</dependency>
3) Remove the gendao dependency from the pom.xml for your api and the other parts which deploy to shared/lib, make sure that gendao is not mentioned in any other pom.xml files
4) Update the transactional wrapper to use one of the new classloader specific ones in gendao utils:
A) From org.springframework.transaction.interceptor.TransactionProxyFactoryBean to:
<bean id="org.sakaiproject.entitybroker.dao.EntityBrokerDao"
class="org.sakaiproject.genericdao.springutil.CurrentClassLoaderTxProxyFactoryBean">
...
OR
B) From org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator to:
<bean class="org.sakaiproject.genericdao.springutil.CurrentClassLoaderBeanNameAutoProxyCreator">
...
That should be all that is required. Note that once this conversion is done, attempting to use hibernate with gendao while still having gendao in shared will cause a failure in the tool. This is why this needs to happen relatively quickly and syncronously for all tools involved. On the other hand, leaving gendao in shared will cause any tools needing a new version or using the new correct method to also fail.