Program: 61317
Project: 61317
Buggy source:
/** 
 * <em>WARNING</em>: this method connects to the database by mean of the  underlying Spring's datasource, not using the provided one, to be fetched via JNDI. This in order to avoid potential conflicts and problems with DbUnit.
 * @param sce
 */
@Override public void contextInitialized(ServletContextEvent sce){
  WebApplicationContext springContext=WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
  DataSource dataSource=(DataSource)springContext.getBean("String_Node_Str");
  DefaultDataTypeFactory dbUnitDataTypeFactory=(DefaultDataTypeFactory)springContext.getBean("String_Node_Str");
  Connection conn=DataSourceUtils.getConnection(dataSource);
  try {
    IDatabaseConnection dbUnitConn=new DatabaseConnection(conn);
    DatabaseConfig config=dbUnitConn.getConfig();
    config.setProperty("String_Node_Str",dbUnitDataTypeFactory);
    boolean existingData=false;
    IDataSet existingDataSet=dbUnitConn.createDataSet();
    for (ITableIterator itor=existingDataSet.iterator(); itor.next() && !existingData; ) {
      existingData=(itor.getTable().getRowCount() > 0);
    }
    if (existingData) {
      log.info("String_Node_Str");
    }
 else {
      log.info("String_Node_Str");
      FlatXmlDataSetBuilder dataSetBuilder=new FlatXmlDataSetBuilder();
      dataSetBuilder.setColumnSensing(true);
      IDataSet dataSet=dataSetBuilder.build(getClass().getResourceAsStream("String_Node_Str"));
      DatabaseOperation.REFRESH.execute(dbUnitConn,dataSet);
    }
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
 finally {
    DataSourceUtils.releaseConnection(conn,dataSource);
  }
}

Fixed version (ground truth):
/** 
 * <em>WARNING</em>: this method connects to the database by mean of the  underlying Spring's datasource, not using the provided one, to be fetched via JNDI. This in order to avoid potential conflicts and problems with DbUnit.
 * @param sce
 */
@Override public void contextInitialized(ServletContextEvent sce){
  WebApplicationContext springContext=WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
  DataSource dataSource=(DataSource)springContext.getBean("String_Node_Str");
  DefaultDataTypeFactory dbUnitDataTypeFactory=(DefaultDataTypeFactory)springContext.getBean("String_Node_Str");
  Connection conn=DataSourceUtils.getConnection(dataSource);
  try {
    IDatabaseConnection dbUnitConn=new DatabaseConnection(conn);
    DatabaseConfig config=dbUnitConn.getConfig();
    config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,dbUnitDataTypeFactory);
    boolean existingData=false;
    IDataSet existingDataSet=dbUnitConn.createDataSet();
    for (ITableIterator itor=existingDataSet.iterator(); itor.next() && !existingData; ) {
      existingData=(itor.getTable().getRowCount() > 0);
    }
    if (existingData) {
      log.info("String_Node_Str");
    }
 else {
      log.info("String_Node_Str");
      FlatXmlDataSetBuilder dataSetBuilder=new FlatXmlDataSetBuilder();
      dataSetBuilder.setColumnSensing(true);
      IDataSet dataSet=dataSetBuilder.build(getClass().getResourceAsStream("String_Node_Str"));
      DatabaseOperation.REFRESH.execute(dbUnitConn,dataSet);
    }
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
 finally {
    DataSourceUtils.releaseConnection(conn,dataSource);
  }
}