@Service public class JdbcServiceImpl extends Object implements JdbcService
JdbcService which uses Spring's JDBC wrapper framework to handle connections and transactions.| Modifier and Type | Field and Description |
|---|---|
static String |
DRIVER_MYSQL |
static String |
DRIVER_ORACLE |
static String |
DRIVER_POSTGRES |
static String |
DRIVER_REDSHIFT |
| Constructor and Description |
|---|
JdbcServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
JdbcExecutionResponse |
executeJdbc(JdbcExecutionRequest jdbcExecutionRequest)
This implementation uses a
DriverManagerDataSource and DefaultTransactionDefinition. |
protected JdbcExecutionResponse |
executeJdbcImpl(JdbcExecutionRequest jdbcExecutionRequest)
This implementation uses a
DriverManagerDataSource. |
public static final String DRIVER_REDSHIFT
public static final String DRIVER_POSTGRES
public static final String DRIVER_ORACLE
public static final String DRIVER_MYSQL
@Transactional(propagation=NOT_SUPPORTED) public JdbcExecutionResponse executeJdbc(JdbcExecutionRequest jdbcExecutionRequest)
DriverManagerDataSource and DefaultTransactionDefinition. It suspends the existing transaction and purposely
runs this logic in "no transaction" to ensure we don't create a connection that would potentially become idle while all JDBC tasks execute. If the
underlying connection pool has an abandoned connection timeout, it would reclaim and close the connection. Then when all the JDBC tasks below finish,
this transaction would try to commit and would generate a "commit failed" exception because the connection is already closed. This approach is fine since
we are not actually doing any "herd" DB operations below. When all the below JDBC operations are finished, nothing would happen here except the callers
transaction would pick up where it left off which would be needed to write workflow variables, etc.executeJdbc in interface JdbcServicejdbcExecutionRequest - The JDBC execution requestprotected JdbcExecutionResponse executeJdbcImpl(JdbcExecutionRequest jdbcExecutionRequest)
DriverManagerDataSource. Uses existing Spring ORM transaction.jdbcExecutionRequest - JDBC execution requestJdbcExecutionResponseCopyright © 2019. All rights reserved.