Example #1
0
 // TODO非同期
 public void executeDelete(PersistenceManager pm, Collection<Long> accessLogsIds) {
   pm.currentTransaction().begin();
   for (Long id : accessLogsIds) {
     AccessLog accessLog = pm.getObjectById(AccessLog.class, id);
     StoreManager.unref(accessLog.getRequestHeaderDigest());
     StoreManager.unref(accessLog.getRequestBodyDigest());
     StoreManager.unref(accessLog.getResponseHeaderDigest());
     StoreManager.unref(accessLog.getResponseBodyDigest());
     pm.deletePersistent(accessLog);
   }
   pm.currentTransaction().commit();
 }
Example #2
0
 @Override
 public void onBufferEnd(Object userContext) {
   endBuffer(currentZe);
   Iterator<String> itr = refDigests.iterator();
   while (itr.hasNext()) {
     StoreManager.ref(itr.next());
   }
   itr = addDigests.iterator();
   while (itr.hasNext()) {
     StoreManager.unref(itr.next());
   }
   JSONObject response = new JSONObject();
   response.element("command", "import");
   response.element("result", "success");
   peer.message(response);
 }