[hibernate-commits] Hibernate SVN: r10935 - branches/Branch_3_2/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Dec 5 17:43:53 EST 2006
Author: epbernard
Date: 2006-12-05 17:43:52 -0500 (Tue, 05 Dec 2006)
New Revision: 10935
Modified:
branches/Branch_3_2/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java
Log:
EJB-256 avoid locking when tomcat and windows is used
Modified: branches/Branch_3_2/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java
===================================================================
--- branches/Branch_3_2/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java 2006-12-05 20:36:35 UTC (rev 10934)
+++ branches/Branch_3_2/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java 2006-12-05 22:43:52 UTC (rev 10935)
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -40,7 +41,12 @@
}
private static Document loadURL(URL configURL, EntityResolver resolver) throws Exception {
- InputStream is = configURL != null ? configURL.openStream() : null;
+ InputStream is = null;
+ if (configURL != null) {
+ URLConnection conn = configURL.openConnection();
+ conn.setUseCaches( false ); //avoid JAR locking on Windows and Tomcat
+ is = conn.getInputStream();
+ }
if ( is == null ) {
throw new IOException( "Failed to obtain InputStream from url: " + configURL );
}
More information about the hibernate-commits
mailing list