private boolean processPendingTransactionAttributes(StatementAttrs attrs, EmbedConnection conn) throws GFXDException { if (attrs == null) { return false; } Map<TransactionAttribute, Boolean> pendingTXAttrs = attrs .getPendingTransactionAttrs(); if (pendingTXAttrs != null && !pendingTXAttrs.isEmpty()) { beginOrAlterTransaction(conn, gfxdConstants.TRANSACTION_NO_CHANGE, pendingTXAttrs, false); } if (attrs.possibleDuplicate) { conn.setPossibleDuplicate(true); return true; } else { return false; } }
private boolean processPendingTransactionAttributes(StatementAttrs attrs, EmbedConnection conn) throws GFXDException { if (attrs == null) { return false; } Map<TransactionAttribute, Boolean> pendingTXAttrs = attrs .getPendingTransactionAttrs(); if (pendingTXAttrs != null && !pendingTXAttrs.isEmpty()) { beginOrAlterTransaction(conn, gfxdConstants.TRANSACTION_NO_CHANGE, pendingTXAttrs, false); } if (attrs.possibleDuplicate) { conn.setPossibleDuplicate(true); return true; } else { return false; } }
final void clearPendingTransactionAttrs() { Map<TransactionAttribute, Boolean> txFlags = this.attrs .getPendingTransactionAttrs(); if (txFlags != null) { this.conn.lock(); try { // It is possible that other statements created off the same connection // flushed the pending TransactionAttribute flags and/or new flags got // added after this statement creation, so go through each flag and // flush only the matching flags with same flushed values for (Map.Entry<TransactionAttribute, Boolean> e : txFlags.entrySet()) { TransactionAttribute txFlag = e.getKey(); boolean isSet = e.getValue().booleanValue(); if (isSet == this.service.isTXFlagSet(txFlag, !isSet)) { this.conn.pendingTXFlags.remove(txFlag); } } } finally { this.conn.unlock(); } this.attrs.setPendingTransactionAttrs(null); } }