cursor.close(); if (txn != null) abort (txn); gcSem.release();
public void push (K key, V value, long timeout) { Transaction txn = null; try { txn = dbe.beginTransaction (null, null); Ref ref = new Ref(key.toString(), value, timeout); pIndex.put (ref); pIndex.delete (ref.getId()); ref.reverseId(); pIndex.put (ref); txn.commit(); txn = null; synchronized (this) { notifyAll (); } if (sl != null) notifyListeners(key, value); } catch (Exception e) { throw new SpaceError (e); } finally { if (txn != null) abort (txn); } } public void push (K key, V value) {
public void out (K key, V value, long timeout) { Transaction txn = null; try { txn = dbe.beginTransaction (null, null); Ref ref = new Ref(key.toString(), value, timeout); pIndex.put (ref); if (timeout > 0L) gcpIndex.putNoReturn ( new GCRef (ref.getId(), ref.getExpiration()) ); txn.commit(); txn = null; synchronized (this) { notifyAll (); } if (sl != null) notifyListeners(key, value); } catch (Exception e) { throw new SpaceError (e); } finally { if (txn != null) abort (txn); } } public void push (K key, V value, long timeout) {