Noel J. Bergman wrote:
It consists in appending to the listMessagesSQL query from
sqlResources.xml a LIMIT xxx. This way, MySQL does not send
back a huge ResultSet which makes the JDBC connection to expire

Good thought regarding LIMIT.  There is code in JDBCSpoolRepository for
limiting the number of messages loaded into an internal working set, but the
SQL query still has to generate the large result set.  There are two places
where we use listMessageSQL:

   JDBCMailRepository.list()
   JDBCSpoolReposittory.loadPendingMessages()

The former is only used by the POP3 handler when listing the contents of the
user's mailbox.  The latter is used internally to load the working set.  I
was thinking that perhaps it doesn't make sense to limit the list given to
the POP3 handler, although it would simply require the user to clear out
their messages before they could retrieve more of them.  Or I could clone
the listMessagesSQL to separate the queries, which is probably a good idea
for other reasons.
Another approach is to use Statement.setMaxRows(int max). Many JDBC drivers can then figure out how to execute this so you achieve the goal of not returning all the records.

--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com/
p. 1.301.656.5501
e. [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to