1 package org.enhydra.snapper.business; 2 3 7 8 import org.enhydra.dods.DODS; 9 import org.enhydra.snapper.Log; 10 import org.enhydra.snapper.spec.*; 11 import com.lutris.appserver.server.sql.DBTransaction; 12 import java.sql.Timestamp ; 13 14 public class IncrementQueryNumber{ 15 16 17 static synchronized void increment(String siteId) 18 { 19 try { 20 DBTransaction dbTransaction = DODS.getDatabaseManager().createTransaction(); 21 22 SiteList sl = SiteListFactory.getSiteList("org.enhydra.snapper.business.SiteListImpl"); 23 Site site = sl.findSiteByID(siteId,dbTransaction); 24 25 int no = site.getQUERYNR() + 1; 26 site.setQUERYNR(no); 27 site.setLASTQUERY(new Timestamp (System.currentTimeMillis())); 28 ((SiteImpl)site).save(); 29 30 dbTransaction.commit(); 31 dbTransaction.release(); 32 33 }catch (Exception e){ 34 Log.logException(e); 35 } 36 } 37 38 39 } | Popular Tags |