java/src/main/java/com/genexus/db/driver/CursorFactory.java
/**
	 * Hace un drop del cursor que hace mas tiempo no se usa.
	 */
Hace un drop del cursor que hace mas tiempo no se usa.
Hace un drop del cursor que hace mas tiempo no se usa .
private int dropOlderCursor() throws SQLException
	{
		long minTimeStamp = Long.MAX_VALUE;
		int  index = -1;
		for(int i = maxSize - 1; i >= 0; i--)
		{
			if 	(timeStamps[i] < minTimeStamp && timeStamps[i] != 0 && !data[i].isInUse())
			{
				minTimeStamp = timeStamps[i];
				index        = i;
			}
		}
		if	(index == -1)
		{
			System.err.println("Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference");
			if	(DEBUG)
				jdbcConnection.log(GXDBDebug.LOG_MED, "Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference");
			throw new InternalError("Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference");
		}
			data[index].getPreparedStatement().close();
			preparedStatements.remove(data[index].getPreparedStatement());
		if	(DEBUG)
			jdbcConnection.log(GXDBDebug.LOG_MED, "GX: Dropping cursor " + arrayIds[index] + " - " + data[index].getSQLSentence());
		data[index]       = null;
		arrayIds[index]   = null;
		timeStamps[index] = 0;
		return index;
	}
private int dropOlderCursor ( ) throws SQLException { long minTimeStamp = Long . MAX_VALUE ; int index = - 1 ; for ( int i = maxSize - 1 ; i >= 0 ; i -- ) { if ( timeStamps [ i ] < minTimeStamp && timeStamps [ i ] != 0 && ! data [ i ] . isInUse ( ) ) { minTimeStamp = timeStamps [ i ] ; index = i ; } } if ( index == - 1 ) { System . err . println ( "Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference" ) ; if ( DEBUG ) jdbcConnection . log ( GXDBDebug . LOG_MED , "Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference" ) ; throw new InternalError ( "Error can't prepare more cursors \n You should increase the Maximum cursors per connection preference" ) ; } data [ index ] . getPreparedStatement ( ) . close ( ) ; preparedStatements . remove ( data [ index ] . getPreparedStatement ( ) ) ; if ( DEBUG ) jdbcConnection . log ( GXDBDebug . LOG_MED , "GX: Dropping cursor " + arrayIds [ index ] + " - " + data [ index ] . getSQLSentence ( ) ) ; data [ index ] = null ; arrayIds [ index ] = null ; timeStamps [ index ] = 0 ; return index ; }
Hace un drop del cursor que hace mas tiempo no se usa.
Hace un drop del cursor que hace mas tiempo no se usa .
// Hago el drop del cursor y reseteo elementos de los arrays. //		try //		{ //		} //		catch (SQLException e) //		{ //			PrivateUtilities.errorHandler("SQL Exception CursorFactory/dropOlderCursor " + e.getErrorCode() + "-" + e.getSQLState(), e); //		}