Grokbase Groups Cayenne dev May 2009
Now when I know of this JDBC feature, I'd prefer to have it in Cayenne
sooner that later. We would also want to have it for other queries than just
only SelectQuery. Could someone help me testing it against different types
of database if I commit?

2009/5/20 stefcl <>
I have posted a small fix in the jira.

I added the following in :
//quick fix : property for setting the jdbc fetch size

protected Integer cursorFetchSize;

* Gets the JDBC fetch size for this query.
* @return the fetch size defined for this query, null if not set.
public Integer getCursorFetchSize()
return cursorFetchSize;

* Sets the JDBC fetch size for this query.
* @param cursorFetchSize the desired fetch size, or null to reset
public void setCursorFetchSize(Integer cursorFetchSize)
this.cursorFetchSize = cursorFetchSize;

//end quick fix

And modified to add the check in performAction :
public void performAction(Connection connection, OperationObserver
throws SQLException, Exception {

long t1 = System.currentTimeMillis();

SelectTranslator translator = createTranslator(connection);
PreparedStatement prepStmt = translator.createStatement();

//quick fix : sets the fetch size
if( query.getCursorFetchSize() != null )
prepStmt.setFetchSize( query.getCursorFetchSize() );
//quick fix end

ResultSet rs = prepStmt.executeQuery();
QueryMetadata md = query.getMetaData(getEntityResolver());



View this message in context:
Sent from the Cayenne - User mailing list archive at

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 11 | next ›
Discussion Overview
groupdev @
postedMay 21, '09 at 12:59p
activeMay 25, '09 at 10:40a



site design / logo © 2022 Grokbase