Re: SelectMethod=cursor and SelectMethod=direct
- From: "Alin Sinpalean" <alin@xxxxxxxxxxxxx>
- Date: 31 Mar 2005 02:59:41 -0800
Frank Brouwer wrote:
> Hi Joe,
>
> Thanks for the answer.
>
> We use prepared statements only, one per connection and we don't use
> updateable and/or scrollable resultsets. All the database
updates/inserts
> are done by sql using a prepared statement and then setting the field
> parameters. After processing a resultset the prepared statement is
closed
> and the connection is returned to the connection pool, using a
"finally
> block" in the method.
>
> Reading your advice it seems best to switch using direct cursors. My
only
> concern is the memory usage as a direct cursor reads the complete
resultset
> into memory (I asume analyzing profiler output).
>
> Any tips on that issue?
You could try another driver, such as jTDS (disclaimer: I'm a jTDS
developer). As you can see the MS driver either retrieves ResultSets
requesting one row at a time (in cursor mode) or caches the ResultSet
contents into memory (in direct mode). There's no other choice. (jTDS
will not retrieve rows one by one or cache them into memory
unnecessarily.)
There are also quite a few commercial drivers, if you can afford them.
A Google search will get you a complete list.
Alin,
The jTDS Project.
.
- References:
- Re: SelectMethod=cursor and SelectMethod=direct
- From: Joe Weinstein
- Re: SelectMethod=cursor and SelectMethod=direct
- From: Frank Brouwer
- Re: SelectMethod=cursor and SelectMethod=direct
- Prev by Date: Re: SelectMethod=cursor and SelectMethod=direct
- Next by Date: Re: SelectMethod=cursor and SelectMethod=direct
- Previous by thread: Re: SelectMethod=cursor and SelectMethod=direct
- Next by thread: Re: SelectMethod=cursor and SelectMethod=direct
- Index(es):
Relevant Pages
|