亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? googoostatementcache.java

?? c3p0數據庫連接池實現源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
    /* non-public methods that MUST be called with this' lock */    abstract boolean prepareAssimilateNewStatement(Connection pcon);    abstract void addStatementToDeathmarches( Object pstmt, Connection physicalConnection );    abstract void removeStatementFromDeathmarches( Object pstmt, Connection physicalConnection );    final int countCachedStatements()    { return stmtToKey.size(); }        private void assimilateNewCheckedOutStatement( StatementCacheKey key, 						   Connection pConn, 						   Object ps )    {	stmtToKey.put( ps, key );	HashSet ks = keySet( key );	if (ks == null)	    keyToKeyRec.put( key, new KeyRec() );  	else 	    {		//System.err.println("-------> Multiply prepared statement! " + key.stmtText );		if (logger.isLoggable(MLevel.INFO))		    logger.info("Multiply prepared statement! " + key.stmtText );		if (Debug.DEBUG && logger.isLoggable(MLevel.FINE))		    logger.fine("(The same statement has already been prepared by this Connection, " +				"and that other instance has not yet been closed, so the statement pool " +				"has to prepare a second PreparedStatement object rather than reusing " +				"the previously-cached Statement. The new Statement will be cached, in case " +				"you frequently need multiple copies of this Statement.)");	    }	keySet( key ).add( ps );	cxnStmtMgr.addStatementForConnection( ps, pConn );	if (Debug.DEBUG && Debug.TRACE == Debug.TRACE_MAX)	    {// 		System.err.println("cxnStmtMgr.statementSet( " + pConn + " ).size(): " + // 				   cxnStmtMgr.statementSet( pConn ).size());		if (logger.isLoggable(MLevel.FINEST))		    logger.finest("cxnStmtMgr.statementSet( " + pConn + " ).size(): " + 				  cxnStmtMgr.statementSet( pConn ).size());	    }	++stmt_count;	checkedOut.add( ps );    }    private void removeStatement( Object ps , boolean force_destroy )    { removeStatement( ps, force_destroy, null ); }    /*     * SIMULTANEOUS CLOSE OF STATEMENT AND CONNECTION BUG WORKAROUND ( counter crap ) -- see closeAll(Connection c)     */    private void removeStatement( Object ps , boolean force_destroy, ChangeNotifyingSynchronizedIntHolder counter )    {	synchronized (removalPending)	    {		if ( removalPending.contains( ps ) )		    return;		else		    removalPending.add(ps);	    }	StatementCacheKey sck = (StatementCacheKey) stmtToKey.remove( ps );	removeFromKeySet( sck, ps );	Connection pConn = sck.physicalConnection;	if (! checkedOut.contains( ps ) )	    {		removeStatementFromDeathmarches( ps, pConn );		removeFromCheckoutQueue( sck , ps );		destroyStatement( ps, counter );	    }	else	    {		checkedOut.remove( ps ); // usually we let it defer destruction until check-in!		if (force_destroy)       // but occasionally we want the statement assuredly gone.		    {			destroyStatement( ps, counter );		    }	    }	boolean check =	cxnStmtMgr.removeStatementForConnection( ps, pConn );	if (Debug.DEBUG && check == false)	    {		//new Exception("WARNING: removed a statement that apparently wasn't in a statement set!!!").printStackTrace();		if (logger.isLoggable(MLevel.WARNING))		    logger.log(MLevel.WARNING, 			       this + " removed a statement that apparently wasn't in a statement set!!!",			       new Exception("LOG STACK TRACE"));	    }	--stmt_count;	synchronized (removalPending)	    { removalPending.remove(ps); }    }    private Object acquireStatement(final Connection pConn, 				    final Method stmtProducingMethod, 				    final Object[] args )	throws SQLException    {	try	    {		final Object[] outHolder = new Object[1];		final SQLException[] exceptionHolder = new SQLException[1];				Runnable r = new Runnable()		    {			public void run()			{			    try				{				    outHolder[0] = 					stmtProducingMethod.invoke( pConn, 								    args ); 				}			    catch ( InvocationTargetException e )				{ 				    Throwable targetException = e.getTargetException();				    if ( targetException instanceof SQLException )					exceptionHolder[0] = (SQLException) targetException;				    else					exceptionHolder[0] 					    = SqlUtils.toSQLException(targetException);				}			    catch ( Exception e )				{ exceptionHolder[0] = SqlUtils.toSQLException(e); }			    finally				{ 				    synchronized ( GooGooStatementCache.this )					{ GooGooStatementCache.this.notifyAll(); }				}			}		    };				blockingTaskAsyncRunner.postRunnable(r);		while ( outHolder[0] == null && exceptionHolder[0] == null )		    this.wait(); //give up our lock while the Statement gets prepared		if (exceptionHolder[0] != null)		    throw exceptionHolder[0];		else		    {			Object out = outHolder[0];			return out;		    }	    }	catch ( InterruptedException e )	    { throw SqlUtils.toSQLException( e ); }    }    private KeyRec keyRec( StatementCacheKey key )    { return ((KeyRec) keyToKeyRec.get( key )); }    private HashSet keySet( StatementCacheKey key )    { 	KeyRec rec = keyRec( key );	return (rec == null ? null : rec.allStmts);     }    private boolean removeFromKeySet( StatementCacheKey key, Object pstmt )    {	boolean out;	HashSet stmtSet = keySet( key );	out = stmtSet.remove( pstmt );	if (stmtSet.isEmpty() && checkoutQueue( key ).isEmpty())	    keyToKeyRec.remove( key );	return out;    }    private LinkedList checkoutQueue( StatementCacheKey key )    { 	KeyRec rec = keyRec( key );	return ( rec == null ? null : rec.checkoutQueue );    }    private boolean removeFromCheckoutQueue( StatementCacheKey key, Object pstmt )    {	boolean out;	LinkedList q = checkoutQueue( key );	out = q.remove( pstmt );	if (q.isEmpty() && keySet( key ).isEmpty())	    keyToKeyRec.remove( key );	return out;    }    private boolean ourResource( Object ps )    { return stmtToKey.keySet().contains( ps ); }    private void refreshStatement( PreparedStatement ps ) throws Exception    { ps.clearParameters(); }    private void printStats()    {	//new Exception("printStats()").printStackTrace();	int total_size = this.countCachedStatements();	int checked_out_size = checkedOut.size();	int num_connections  = cxnStmtMgr.getNumConnectionsWithCachedStatements(); 	int num_keys = keyToKeyRec.size(); 	System.err.print(this.getClass().getName() + " stats -- ");	System.err.print("total size: " + total_size);	System.err.print("; checked out: " + checked_out_size);	System.err.print("; num connections: " + num_connections);	System.err.println("; num keys: " + num_keys);    }    private String statsString()    {	int total_size = this.countCachedStatements();	int checked_out_size = checkedOut.size();	int num_connections  = cxnStmtMgr.getNumConnectionsWithCachedStatements(); 	int num_keys = keyToKeyRec.size(); 	StringBuffer sb = new StringBuffer(255);	sb.append(this.getClass().getName());	sb.append(" stats -- ");	sb.append("total size: ");	sb.append(total_size);	sb.append("; checked out: ");	sb.append(checked_out_size);	sb.append("; num connections: ");	sb.append(num_connections);	sb.append("; num keys: ");	sb.append(num_keys);	return sb.toString();    }    private static class KeyRec    {	HashSet  allStmts       = new HashSet();	LinkedList checkoutQueue  = new LinkedList();    }    protected class Deathmarch    {	TreeMap longsToStmts = new TreeMap(); 	HashMap stmtsToLongs = new HashMap();	long last_long = -1;	public void deathmarchStatement( Object ps )	{	    //System.err.println("deathmarchStatement( " + ps + " )");	    if (Debug.DEBUG)		{		    Long old = (Long) stmtsToLongs.get( ps );		    if (old != null)			throw new RuntimeException("Internal inconsistency: " +						   "A statement is being double-deathmatched. no checked-out statements should be in a deathmarch already; " +						   "no already checked-in statement should be deathmarched!");		}	    Long youth = getNextLong();	    stmtsToLongs.put( ps, youth );	    longsToStmts.put( youth, ps );	}	public void undeathmarchStatement( Object ps )	{	    Long old = (Long) stmtsToLongs.remove( ps );	    if (Debug.DEBUG && old == null)		throw new RuntimeException("Internal inconsistency: " +					   "A (not new) checking-out statement is not in deathmarch.");	    Object check = longsToStmts.remove( old );	    if (Debug.DEBUG && old == null)		throw new RuntimeException("Internal inconsistency: " +					   "A (not new) checking-out statement is not in deathmarch.");	}	public boolean cullNext()	{	    if ( longsToStmts.isEmpty() )		return false;	    else		{		    Long l = (Long) longsToStmts.firstKey();		    Object ps = longsToStmts.get( l );		    if (Debug.DEBUG && Debug.TRACE == Debug.TRACE_MAX)			{// 			    System.err.println("CULLING: " + // 					       ((StatementCacheKey) stmtToKey.get(ps)).stmtText);			    if (logger.isLoggable(MLevel.FINEST))				logger.finest("CULLING: " + ((StatementCacheKey) stmtToKey.get(ps)).stmtText);			}		    // we do not undeathmarch the statement ourselves, because removeStatement( ... )		    // should remove from all deathmarches...		    removeStatement( ps, true ); 		    if (Debug.DEBUG && this.contains( ps ))			throw new RuntimeException("Inconsistency!!! Statement culled from deathmarch failed to be removed by removeStatement( ... )!");		    return true;		}	}	public boolean contains( Object ps )	{ return stmtsToLongs.keySet().contains( ps ); }	public int size()	{ return longsToStmts.size(); }	private Long getNextLong()	{ return new Long( ++last_long ); }    }    protected static abstract class ConnectionStatementManager    {	Map cxnToStmtSets = new HashMap();	public int getNumConnectionsWithCachedStatements()	{ return cxnToStmtSets.size(); }	public Set statementSet( Connection pcon )	{ return (Set) cxnToStmtSets.get( pcon ); }	public int getNumStatementsForConnection( Connection pcon )	{	    Set stmtSet = statementSet( pcon );	    return (stmtSet == null ? 0 : stmtSet.size());	}	public void addStatementForConnection( Object ps, Connection pcon )	{	    Set stmtSet = statementSet( pcon );	    if (stmtSet == null)		{		    stmtSet = new HashSet();		    cxnToStmtSets.put( pcon, stmtSet );		}	    stmtSet.add( ps );	}	public boolean removeStatementForConnection( Object ps, Connection pcon )	{	    boolean out;	    Set stmtSet = statementSet( pcon );	    if ( stmtSet != null )		{		    out = stmtSet.remove( ps );		    if (stmtSet.isEmpty())			cxnToStmtSets.remove( pcon );		}	    else		out = false;	    return out;	}    }    // i want this as optimized as possible, so i'm adopting the philosophy that all    // classes are abstract or final, to help enable compiler inlining...    protected static final class SimpleConnectionStatementManager extends ConnectionStatementManager     {}    protected final class DeathmarchConnectionStatementManager extends ConnectionStatementManager    {	Map cxnsToDms = new HashMap();	public void addStatementForConnection( Object ps, Connection pcon )	{	    super.addStatementForConnection( ps, pcon );	    Deathmarch dm = (Deathmarch) cxnsToDms.get( pcon );	    if (dm == null)		{		    dm = new Deathmarch();		    cxnsToDms.put( pcon, dm );		}	}	public boolean removeStatementForConnection( Object ps, Connection pcon )	{	    boolean out = super.removeStatementForConnection( ps, pcon );	    if (out)		{		    if ( statementSet( pcon ) == null )			cxnsToDms.remove( pcon );		}	    return out;	}	public Deathmarch getDeathmarch( Connection pcon )	{ return (Deathmarch) cxnsToDms.get( pcon ); }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
肉肉av福利一精品导航| 午夜精品一区二区三区电影天堂| 国内精品国产三级国产a久久| 精品国产一区二区三区久久久蜜月| 美女任你摸久久| 日韩欧美国产电影| 成人美女视频在线观看18| 国产精品污网站| 色噜噜狠狠一区二区三区果冻| 一个色综合网站| 欧美一区二区私人影院日本| 狠狠色综合日日| 成人欧美一区二区三区在线播放| 欧亚洲嫩模精品一区三区| 午夜婷婷国产麻豆精品| 精品久久久久久久人人人人传媒| 懂色av噜噜一区二区三区av | 日韩你懂的在线播放| 国产综合久久久久久鬼色| 亚洲啪啪综合av一区二区三区| 欧美日韩一区久久| 国产在线精品免费av| 亚洲精品免费在线| 精品区一区二区| 91看片淫黄大片一级在线观看| 亚洲mv在线观看| 国产日韩一级二级三级| 欧美日韩一本到| 国产一区二区毛片| 亚洲一区二区三区影院| www国产精品av| 91麻豆123| 国产精品一区二区久久不卡| 亚洲夂夂婷婷色拍ww47| 久久嫩草精品久久久精品一| 欧美在线观看视频在线| 国产精品99久| 日韩二区三区在线观看| 国产日韩精品一区二区三区| 欧美电影在线免费观看| 成人av免费观看| 久久精品国产一区二区三区免费看| 国产精品二三区| 久久人人97超碰com| 欧美午夜视频网站| 99精品在线免费| 国产精品123区| 日本系列欧美系列| 亚洲高清免费观看高清完整版在线观看| 久久久三级国产网站| 欧美麻豆精品久久久久久| 99视频一区二区| 国产精品自在欧美一区| 日韩国产成人精品| 亚洲大片精品永久免费| 亚洲精品自拍动漫在线| 日本一区二区高清| 久久精品日韩一区二区三区| 欧美v亚洲v综合ⅴ国产v| 69堂亚洲精品首页| 欧美精品123区| 精品污污网站免费看| 91国产免费观看| 色综合久久久久综合体桃花网| 国产精品自拍网站| 国产麻豆精品95视频| 国内久久婷婷综合| 韩国三级在线一区| 国产精品综合网| 国产精品一区二区无线| 国产精品一区二区三区99| 国产一区福利在线| 国产伦精品一区二区三区免费迷 | 一本到三区不卡视频| 成人高清视频免费观看| 高清不卡一区二区在线| 成人国产精品免费网站| 成人一级片在线观看| 成人avav影音| 91视视频在线观看入口直接观看www| www.成人网.com| 91在线你懂得| 欧美日韩一区二区在线观看| 欧美亚洲自拍偷拍| 欧美日韩免费观看一区三区| 欧美三级日韩三级国产三级| 欧美三片在线视频观看| 欧美高清视频www夜色资源网| 欧美精品丝袜久久久中文字幕| 欧美日韩电影一区| 日韩欧美电影一二三| 久久久亚洲综合| 国产精品毛片久久久久久久| 亚洲色图一区二区三区| 香蕉影视欧美成人| 麻豆精品在线视频| 国产成人免费视频网站高清观看视频 | 亚洲18色成人| 老司机精品视频导航| 国产成人免费av在线| 色综合久久久久久久| 69堂亚洲精品首页| 国产日本一区二区| 亚洲一区中文日韩| 经典三级视频一区| 99在线精品视频| 91精品国产91久久久久久一区二区| 精品乱人伦一区二区三区| 国产精品你懂的| 日韩高清不卡一区二区| 成人免费看黄yyy456| 欧美日韩三级视频| 欧美经典一区二区| 午夜国产精品一区| 成人午夜电影网站| 欧美猛男男办公室激情| 中文字幕巨乱亚洲| 午夜视频一区二区| 波多野结衣亚洲| 日韩欧美一二三区| 一区二区成人在线| 国产精品538一区二区在线| 欧美三区在线观看| 国产精品区一区二区三区| 丝袜国产日韩另类美女| 成人免费视频app| 日韩欧美精品在线视频| 亚洲激情自拍视频| 成人一区二区三区视频| 日韩视频在线观看一区二区| 一级女性全黄久久生活片免费| 国产精品91一区二区| 欧美精品粉嫩高潮一区二区| 国产精品美女视频| 精品综合免费视频观看| 在线观看一区二区视频| 中文字幕五月欧美| 国内精品国产成人| 91精品国产综合久久国产大片| 亚洲私人黄色宅男| 成人小视频免费观看| 精品国产髙清在线看国产毛片| 亚洲国产一区在线观看| 99国产麻豆精品| 久久久欧美精品sm网站| 久久狠狠亚洲综合| 欧美老肥妇做.爰bbww视频| 亚洲欧美另类小说| 不卡av电影在线播放| 国产日韩欧美高清| 国产盗摄一区二区三区| 精品成人免费观看| 麻豆91在线观看| 日韩一区二区电影网| 日韩高清在线不卡| 91精品国产综合久久福利| 性欧美疯狂xxxxbbbb| 欧美日韩一二三| 亚洲一区二区av在线| 91国产精品成人| 一区二区三区欧美日韩| 色婷婷综合久色| 一区二区三区在线高清| 91美女精品福利| 亚洲宅男天堂在线观看无病毒| 色偷偷一区二区三区| 亚洲另类一区二区| 在线观看一区不卡| 午夜激情久久久| 91精品国产欧美一区二区成人| 日韩国产一区二| 日韩精品一区二区三区视频播放 | 国产欧美一区视频| 国产成人在线电影| 国产精品乱码久久久久久| 成人a区在线观看| 日韩一区日韩二区| 欧美一a一片一级一片| 日韩av网站免费在线| 精品国产成人系列| 成人永久aaa| 一区二区激情视频| 91精品国产综合久久婷婷香蕉| 久久精品国产精品亚洲红杏| 久久久久久黄色| 91在线国产观看| 首页欧美精品中文字幕| 日韩欧美在线一区二区三区| 国产一区二区不卡老阿姨| 成人欧美一区二区三区1314| 欧美日韩1234| 国产呦萝稀缺另类资源| 亚洲欧美怡红院| 欧美人妇做爰xxxⅹ性高电影| 韩国av一区二区三区| 亚洲摸摸操操av| 日韩一区二区精品葵司在线| 成人av网站在线观看| 日韩和欧美的一区| 国产亚洲1区2区3区|