@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
@Override public synchronized void afterCompletion(int status) { completed = true; synchronizations.remove(id); if (transactionMode == TransactionMode.ISOLATE_READS) { for (TempTable table : tables.values()) { table.getActive().decrementAndGet(); } } else { HashSet<TempTable> current = new HashSet<TempTable>(tempTables.values()); current.retainAll(tables.values()); for (TempTable table : current) { table.getActive().set(0); table.getTree().clearClonedFlags(); } } for (TransactionCallback callback : callbacks) { if (status == Status.STATUS_COMMITTED) { callback.commit(); } else { callback.rollback(); } } callbacks.clear(); }
throw new AssertionError("Expected active transaction"); //$NON-NLS-1$ if (!tempTable.getActive().compareAndSet(0, 1)) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); } else if (tempTable.getActive().get() != 0) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); if (!synch.isCompleted()) { synch.tables.put(tempTableID, tempTable); result.getActive().getAndIncrement();
throw new AssertionError("Expected active transaction"); //$NON-NLS-1$ if (!tempTable.getActive().compareAndSet(0, 1)) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); } else if (tempTable.getActive().get() != 0) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); if (!synch.isCompleted()) { synch.tables.put(tempTableID, tempTable); result.getActive().getAndIncrement();
throw new AssertionError("Expected active transaction"); //$NON-NLS-1$ if (!tempTable.getActive().compareAndSet(0, 1)) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); } else if (tempTable.getActive().get() != 0) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30227, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30227, tempTableID)); if (!synch.isCompleted()) { synch.tables.put(tempTableID, tempTable); result.getActive().getAndIncrement();
@Override public List<?> updateMatViewRow(String matTableName, List<?> tuple, boolean delete) throws TeiidComponentException { TempTable tempTable = tableStore.getTempTable(matTableName); if (tempTable != null) { TempMetadataID id = tableStore.getMetadataStore().getTempGroupID(matTableName); synchronized (id) { boolean clone = tempTable.getActive().get() != 0; if (clone) { tempTable = tempTable.clone(); } List<?> result = tempTable.updateTuple(tuple, delete); if (clone) { swapTempTable(matTableName, tempTable); } return result; } } return null; }
@Override public List<?> updateMatViewRow(String matTableName, List<?> tuple, boolean delete) throws TeiidComponentException { TempTable tempTable = tableStore.getTempTable(matTableName); if (tempTable != null) { TempMetadataID id = tableStore.getMetadataStore().getTempGroupID(matTableName); synchronized (id) { boolean clone = tempTable.getActive().get() != 0; if (clone) { tempTable = tempTable.clone(); } List<?> result = tempTable.updateTuple(tuple, delete); if (clone) { swapTempTable(matTableName, tempTable); } return result; } } return null; }
@Override public List<?> updateMatViewRow(String matTableName, List<?> tuple, boolean delete) throws TeiidComponentException { TempTable tempTable = tableStore.getTempTable(matTableName); if (tempTable != null) { TempMetadataID id = tableStore.getMetadataStore().getTempGroupID(matTableName); synchronized (id) { boolean clone = tempTable.getActive().get() != 0; if (clone) { tempTable = tempTable.clone(); } List<?> result = tempTable.updateTuple(tuple, delete); if (clone) { swapTempTable(matTableName, tempTable); } return result; } } return null; }