db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lch...@gmx.net
Subject Scrollable Resultsets in JdbcAccess
Date Mon, 20 Jan 2003 11:57:44 GMT
hi!

As of OJB 0.9.8 the scrollable flag in method JDBCAccess.executeSQL() has
been set from 
Query.SCROLLABLE to Query.NOT_SCROLLABLE, which causes RsIterator.size()
always to
use count(*) method to determine the size although the JDBC driver supports
it.

	public int size() throws PersistenceBrokerException
	{
		int retval = 0; // default size is 0;
		boolean forwardOnly = true;
		try
		{
# forwardOnly flag yields true			forwardOnly =
m_rsAndStmt.m_stmt.getResultSetType() == ResultSet.TYPE_FORWARD_ONLY;
		}
		catch (SQLException e)
		{
		}
		if (!supportsAdvancedJDBCCursorControl()
			||
PlatformFactory.getPlatformFor(m_cld.getConnectionDescriptor()).useCountForResultsetSize()
			|| forwardOnly)
		{
			/**
			 * MBAIRD: doesn't support the .last .getRow method, use the .getCount on
the
			 * persistenceBroker which executes a count(*) query.
			 */
			if (logger.isDebugEnabled()) logger.debug("Executing count(*) to get
size()");
			retval = countedSize();
		}
		else
		...

Why has to been changed and how can i force size() not to take the count(*)
method?

thanks,

Liang Cheng

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


Mime
View raw message