Search in sources :

Example 1 with BatchAndSimpleSameTrx

use of de.example.mybatis.spring.service.BatchAndSimpleSameTrx in project JavaForFun by gumartinm.

the class TestMain method main.

public static void main(final String[] args) {
    logger.info("Starting application");
    // final ExampleService exampleService = (ExampleService) SpringContextLocator
    // .getInstance().getBean("exampleService");
    // 
    // exampleService.insertNewAd();
    // 
    // exampleService.getAdsByCriteria();
    // 
    // 
    // final ExampleBatchService exampleBatchService = (ExampleBatchService) SpringContextLocator
    // .getInstance().getBean("exampleBatchService");
    // 
    // exampleBatchService.insertNewAd();
    // 
    // exampleBatchService.insertBatchNewAd();
    final BatchAndSimpleSameTrx batchAndSimpleSameTrx = (BatchAndSimpleSameTrx) SpringContextLocator.getInstance().getBean("batchAndSimpleSameTrx");
    try {
        batchAndSimpleSameTrx.insertNewAd();
    } catch (CannotGetJdbcConnectionException e) {
        logger.error("Error exception: ", e);
    } catch (SQLException e) {
        logger.error("Error exception: ", e);
    }
}
Also used : CannotGetJdbcConnectionException(org.springframework.jdbc.CannotGetJdbcConnectionException) SQLException(java.sql.SQLException) BatchAndSimpleSameTrx(de.example.mybatis.spring.service.BatchAndSimpleSameTrx)

Aggregations

BatchAndSimpleSameTrx (de.example.mybatis.spring.service.BatchAndSimpleSameTrx)1 SQLException (java.sql.SQLException)1 CannotGetJdbcConnectionException (org.springframework.jdbc.CannotGetJdbcConnectionException)1