Caches every created preparedStatement in Closure closure Every cached preparedStatement is closed after closure has been called. If the closure takes a single argument, it will be called with the connection, otherwise it will be called with no arguments. @param closure the given closure @th
(@ClosureParams(value=SimpleType.class, options="java.sql.Connection") Closure closure)
| 4394 | * @see #setCacheStatements(boolean) |
| 4395 | */ |
| 4396 | public void cacheStatements(@ClosureParams(value=SimpleType.class, options="java.sql.Connection") Closure closure) throws SQLException { |
| 4397 | boolean savedCacheStatements = cacheStatements; |
| 4398 | cacheStatements = true; |
| 4399 | Connection connection = null; |
| 4400 | try { |
| 4401 | connection = createConnection(); |
| 4402 | callClosurePossiblyWithConnection(closure, connection); |
| 4403 | } finally { |
| 4404 | cacheStatements = false; |
| 4405 | closeResources(connection, null); |
| 4406 | cacheStatements = savedCacheStatements; |
| 4407 | } |
| 4408 | } |
| 4409 | |
| 4410 | // protected implementation methods - extension points for subclasses |
| 4411 | //------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected