Search in sources :

Example 1 with PreparedStatementCache

use of org.eclipse.scout.rt.server.jdbc.internal.exec.PreparedStatementCache in project scout.rt by eclipse.

the class AbstractSqlService method getStatementCache.

/**
 * @return the statement cache used for this {@link ITransaction} transaction
 */
protected final IStatementCache getStatementCache() {
    ITransaction tx = Assertions.assertNotNull(ITransaction.CURRENT.get(), "Transaction required");
    IStatementCache res = (IStatementCache) tx.getMember(PreparedStatementCache.TRANSACTION_MEMBER_ID);
    if (res == null) {
        res = new PreparedStatementCache(getJdbcStatementCacheSize());
        tx.registerMember((ITransactionMember) res);
    }
    return res;
}
Also used : PreparedStatementCache(org.eclipse.scout.rt.server.jdbc.internal.exec.PreparedStatementCache) ITransaction(org.eclipse.scout.rt.platform.transaction.ITransaction)

Example 2 with PreparedStatementCache

use of org.eclipse.scout.rt.server.jdbc.internal.exec.PreparedStatementCache in project scout.rt by eclipse.

the class SqlServiceMock method selectInto.

@Override
public void selectInto(String s, Object... bindBases) {
    createPlainTextLog(s, bindBases);
    createStatementProcessor(s, bindBases, 0).processSelectInto(getTransaction(), new PreparedStatementCache(1), null);
}
Also used : PreparedStatementCache(org.eclipse.scout.rt.server.jdbc.internal.exec.PreparedStatementCache)

Aggregations

PreparedStatementCache (org.eclipse.scout.rt.server.jdbc.internal.exec.PreparedStatementCache)2 ITransaction (org.eclipse.scout.rt.platform.transaction.ITransaction)1