|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2009 the original author or authors. |
| 2 | + * Copyright 2002-2010 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
23 | 23 | import java.util.ArrayList;
|
24 | 24 | import java.util.List;
|
25 | 25 | import java.util.Properties;
|
26 |
| - |
27 | 26 | import javax.sql.DataSource;
|
28 | 27 |
|
29 | 28 | import junit.framework.TestCase;
|
@@ -123,7 +122,7 @@ protected SessionFactory newSessionFactory(Configuration config) throws Hibernat
|
123 | 122 | }
|
124 | 123 | };
|
125 | 124 | lsfb.afterPropertiesSet();
|
126 |
| - final SessionFactory sfProxy = (SessionFactory) lsfb.getObject(); |
| 125 | + final SessionFactory sfProxy = lsfb.getObject(); |
127 | 126 |
|
128 | 127 | HibernateTransactionManager tm = new HibernateTransactionManager();
|
129 | 128 | tm.setJdbcExceptionTranslator(new SQLStateSQLExceptionTranslator());
|
@@ -345,7 +344,7 @@ protected SessionFactory newSessionFactory(Configuration config) throws Hibernat
|
345 | 344 | }
|
346 | 345 | };
|
347 | 346 | lsfb.afterPropertiesSet();
|
348 |
| - final SessionFactory sfProxy = (SessionFactory) lsfb.getObject(); |
| 347 | + final SessionFactory sfProxy = lsfb.getObject(); |
349 | 348 |
|
350 | 349 | HibernateTransactionManager tm = new HibernateTransactionManager();
|
351 | 350 | tm.setJdbcExceptionTranslator(new SQLStateSQLExceptionTranslator());
|
@@ -422,7 +421,7 @@ protected SessionFactory newSessionFactory(Configuration config) throws Hibernat
|
422 | 421 | }
|
423 | 422 | };
|
424 | 423 | lsfb.afterPropertiesSet();
|
425 |
| - final SessionFactory sfProxy = (SessionFactory) lsfb.getObject(); |
| 424 | + final SessionFactory sfProxy = lsfb.getObject(); |
426 | 425 |
|
427 | 426 | PlatformTransactionManager tm = new HibernateTransactionManager(sfProxy);
|
428 | 427 | final TransactionTemplate tt = new TransactionTemplate(tm);
|
@@ -776,7 +775,7 @@ protected SessionFactory newSessionFactory(Configuration config) throws Hibernat
|
776 | 775 | }
|
777 | 776 | };
|
778 | 777 | lsfb.afterPropertiesSet();
|
779 |
| - final SessionFactory sfProxy = (SessionFactory) lsfb.getObject(); |
| 778 | + final SessionFactory sfProxy = lsfb.getObject(); |
780 | 779 |
|
781 | 780 | PlatformTransactionManager tm = new HibernateTransactionManager(sfProxy);
|
782 | 781 | TransactionTemplate tt = new TransactionTemplate(tm);
|
@@ -860,7 +859,7 @@ protected SessionFactory newSessionFactory(Configuration config) throws Hibernat
|
860 | 859 | }
|
861 | 860 | };
|
862 | 861 | lsfb.afterPropertiesSet();
|
863 |
| - final SessionFactory sfProxy = (SessionFactory) lsfb.getObject(); |
| 862 | + final SessionFactory sfProxy = lsfb.getObject(); |
864 | 863 |
|
865 | 864 | PlatformTransactionManager tm = new HibernateTransactionManager(sfProxy);
|
866 | 865 | TransactionTemplate tt = new TransactionTemplate(tm);
|
@@ -1657,7 +1656,7 @@ public void testTransactionCommitWithNonExistingDatabase() throws Exception {
|
1657 | 1656 | props.setProperty("hibernate.cache.provider_class", NoCacheProvider.class.getName());
|
1658 | 1657 | lsfb.setHibernateProperties(props);
|
1659 | 1658 | lsfb.afterPropertiesSet();
|
1660 |
| - final SessionFactory sf = (SessionFactory) lsfb.getObject(); |
| 1659 | + final SessionFactory sf = lsfb.getObject(); |
1661 | 1660 |
|
1662 | 1661 | HibernateTransactionManager tm = new HibernateTransactionManager();
|
1663 | 1662 | tm.setSessionFactory(sf);
|
@@ -1698,7 +1697,7 @@ public void testTransactionCommitWithPreBoundSessionAndNonExistingDatabase() thr
|
1698 | 1697 | props.setProperty("hibernate.cache.provider_class", NoCacheProvider.class.getName());
|
1699 | 1698 | lsfb.setHibernateProperties(props);
|
1700 | 1699 | lsfb.afterPropertiesSet();
|
1701 |
| - final SessionFactory sf = (SessionFactory) lsfb.getObject(); |
| 1700 | + final SessionFactory sf = lsfb.getObject(); |
1702 | 1701 |
|
1703 | 1702 | HibernateTransactionManager tm = new HibernateTransactionManager();
|
1704 | 1703 | tm.setSessionFactory(sf);
|
@@ -1751,9 +1750,10 @@ public void testTransactionCommitWithNonExistingDatabaseAndLazyConnection() thro
|
1751 | 1750 | Properties props = new Properties();
|
1752 | 1751 | props.setProperty("hibernate.dialect", HSQLDialect.class.getName());
|
1753 | 1752 | props.setProperty("hibernate.cache.provider_class", NoCacheProvider.class.getName());
|
| 1753 | + props.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); |
1754 | 1754 | lsfb.setHibernateProperties(props);
|
1755 | 1755 | lsfb.afterPropertiesSet();
|
1756 |
| - final SessionFactory sf = (SessionFactory) lsfb.getObject(); |
| 1756 | + final SessionFactory sf = lsfb.getObject(); |
1757 | 1757 |
|
1758 | 1758 | HibernateTransactionManager tm = new HibernateTransactionManager();
|
1759 | 1759 | tm.setSessionFactory(sf);
|
|
0 commit comments