Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy


    }
  }

  public void testClobStringTypeWithSynchronizedConnection() throws Exception {
    DataSource dsTarget = new DriverManagerDataSource();
    DataSource ds = new LazyConnectionDataSourceProxy(dsTarget);

    lobHandler.getClobAsString(rs, 1);
    lobHandlerControl.setReturnValue("content", 2);
    lobCreator.setClobAsString(ps, 1, "content");
    lobCreatorControl.setVoidCallable(1);
View Full Code Here


    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
  }

  public void testTransactionCommitWithNonExistingDatabaseAndLazyConnection() throws Exception {
    DriverManagerDataSource dsTarget = new DriverManagerDataSource();
    final LazyConnectionDataSourceProxy ds = new LazyConnectionDataSourceProxy();
    ds.setTargetDataSource(dsTarget);
    ds.setDefaultAutoCommit(true);
    ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    //ds.setDefaultTransactionIsolationName("TRANSACTION_READ_COMMITTED");

    LocalSessionFactoryBean lsfb = new LocalSessionFactoryBean();
    lsfb.setDataSource(ds);
    Properties props = new Properties();
View Full Code Here

                }
            }
        });
       
        // Springframework provided proxies that make working with transactions much easier
        LazyConnectionDataSourceProxy lazyProxy = new LazyConnectionDataSourceProxy(dataSource);
       
        setInstance(dsName, lazyProxy);
    }
View Full Code Here

  }

  @Test
  public void testTransactionCommitWithNonExistingDatabaseAndLazyConnection() throws Exception {
    DriverManagerDataSource dsTarget = new DriverManagerDataSource();
    final LazyConnectionDataSourceProxy ds = new LazyConnectionDataSourceProxy();
    ds.setTargetDataSource(dsTarget);
    ds.setDefaultAutoCommit(true);
    ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    //ds.setDefaultTransactionIsolationName("TRANSACTION_READ_COMMITTED");

    LocalSessionFactoryBean lsfb = new LocalSessionFactoryBean();
    lsfb.setDataSource(ds);
    Properties props = new Properties();
View Full Code Here

  }

  @Test
  public void testTransactionCommitWithNonExistingDatabaseAndLazyConnection() throws Exception {
    DriverManagerDataSource dsTarget = new DriverManagerDataSource();
    final LazyConnectionDataSourceProxy ds = new LazyConnectionDataSourceProxy();
    ds.setTargetDataSource(dsTarget);
    ds.setDefaultAutoCommit(true);
    ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    //ds.setDefaultTransactionIsolationName("TRANSACTION_READ_COMMITTED");

    LocalSessionFactoryBean lsfb = new LocalSessionFactoryBean();
    lsfb.setDataSource(ds);
    Properties props = new Properties();
View Full Code Here

    }
  }

  public DataSource getDataSource(String uri) {
    HiveBasicDataSource ds = new HiveBasicDataSource(uri);
    LazyConnectionDataSourceProxy dataSourceProxy = new LazyConnectionDataSourceProxy(ds);
    dataSourcesToClose.add(ds);
    return dataSourceProxy;
  }
View Full Code Here

                        dataSourceToUse = pp.postProcess(dataSourceToUse);
                    }
                }
            }

            dataSources.put(descriptor.getIdentity(), new LazyConnectionDataSourceProxy(
                    dataSourceToUse));
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.