Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Transaction select and selectAndProcess #17

@dportabella

Description

@dportabella

Transaction.select
/**
* Returns all records returned by the query after being converted by the
* given block. All objects are kept in memory to this method is no suited
* for very big result sets. Use selectAndProcess if you need to process
* bigger datasets.
...
*/

I've a big resultset, and I get a OutOfMemoryException with Transaction.select.
I've solved it using selectAndProcess instead of select.

However, why does select have this limitation?
why does it keep all the rows in memory?
couldn't it return an iterator, instead of a sequence, and call the block when the iterator requires it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions