[ http://jira.andromda.org/browse/SPRING-194?page=all ] Jens Vagts reopened SPRING-194: -------------------------------
Assign To: Jens Vagts (was: Chad Brandon) It's not JBoss, who is caching the jndi object, it's spring. The new (hardcoded) setting results in a jndi lookup for each data request (worst case: each query). This setting makes sense only if one requires hot-deployment of the *jndi datasource.* Hot-deployment of the application does not require it, since it makes the lookup on startup/deploy. I'll at a new namespace property "jndiDataSourceCaching" to the spring cartridge to be able to configure both scenarios. The default will be "true", since it's the "old" behaviour. > Error accessing application on JBoss after repeated deployments of *-ds.xml > files. > ---------------------------------------------------------------------------------- > > Key: SPRING-194 > URL: http://jira.andromda.org/browse/SPRING-194 > Project: Spring Cartridge > Type: Improvement > Versions: 3.2-RC2, 3.2 > Environment: CPU: Intel Pentium-4 M with Centrino @ 2GHz, Intel dual-core > Xeon @ 3GHz > Operating system: Windows XP Professional Service Pack 2, RedHat Linux > Enterprise Edition > JVM version: Sun JVM 1.5 patch 8 > JBoss application server version: 4.0.04 > Database: MySQL > AndroMDA version: 3.2 > Reporter: Manish Baxi > Assignee: Jens Vagts > Priority: Critical > Attachments: applicationContext-dataSource.xml.vsl > > If we deploy an application repeatedly to a running JBoss application server, > the application becomes unusable, even though JBoss runs fine and does not > show any errors of its own. JBoss server logs show the following exception > message: > You are trying to use a connection factory that has been shut down: > ManagedConnectionFactory is null. > After lots of reading, investigation and trials-and-errors we reached the > conclusion that the error occurs only if th *-ds.xml files are released along > with the EAR or the WAR file. If we manually deploy just the EAR file, we > can keep JBoss and the application running forever. > After spending some time going through JBoss documentation, we made a change > to our applicationContext-dataSource.xml file used by SPRING. The change was > as follows: > ================================================================================================ > Original content > ================================================================================================ > <!-- JNDI DataSource for J2EE environments --> > <bean id="dataSource" class="my-application"> > <property > name="jndiName"><value>jndi://my-application</value></property> > </bean> > ================================================================================================ > ================================================================================================ > New content > ================================================================================================ > <!-- JNDI DataSource for J2EE environments --> > <bean id="dataSource" class="my-application"> > <property > name="jndiName"><value>jndi://my-application</value></property> > <property name="cache"><value>false</value></property> > <property > name="proxyInterface"><value>javax.sql.DataSource</value></property> > </bean> > ================================================================================================ > As can be seen, we added two more properties to the Data Source bean. This > prevents JBoss from caching the data source objects when an application is > undeployed and create them afresh when the application is deployed again. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.andromda.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/