You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Srinivasa Segu (JIRA)" <ji...@apache.org> on 2007/03/20 00:57:32 UTC

[jira] Created: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
--------------------------------------------------------------------------

                 Key: OPENJPA-175
                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 0.9.6, 0.9.0
            Reporter: Srinivasa Segu


The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Srinivasa (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Srinivasa resolved OPENJPA-175.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.7

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa
>             Fix For: 0.9.7
>
>         Attachments: InExpression-Diff.txt, OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Abe White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482931 ] 

Abe White commented on OPENJPA-175:
-----------------------------------

1. Are you also going to fix InExpression to honor the DBDictionary's new in clause limit?
2. After reviewing the patch some more, I propose the following simplified version:

        // try to find a good page size.  if the known size < batch size, use
        // it.  if the batch size is set, then use that; if it's sorta close
        // to the size, then use the size / 2 to get two full pages rather
        // than a possible big one and small one
        int batch = getFetchConfiguration().getFetchBatchSize();
        int pageSize;
        if (batch < 0)
            pageSize = (int) size;
        else {
            if (batch == 0)
                batch = 50; // reasonable default
            if (size <= batch)
                pageSize = (int) size;
            else if (size <= batch * 2) {
                if (size % 2 == 0)
                    pageSize = (int) (size / 2);
                else
                    pageSize = (int) (size / 2 + 1);
            } else
                pageSize = batch;
        } 

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa
>         Attachments: OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Srinivasa Segu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Srinivasa Segu updated OPENJPA-175:
-----------------------------------

    Attachment: OPENJPA-175-patch.txt

Patch with fixes to address the FetchBatchSize values of -1, 0. For FetchBatchSize being 0 or negative value other than -1 uses the earlier logic of determining a pageSize capped by 50 based on size.

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa Segu
>         Attachments: OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Abe White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482409 ] 

Abe White commented on OPENJPA-175:
-----------------------------------

+1, with some caveats:

- The proposed patch doesn't handle the common cases where the FetchBatchSize is -1 (unlimited) or 0 (driver default).
- I'm a little nervous about defaulting the in clause limit to "unlimited" when we don't have much info on actual database limits other than Oracle.

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa Segu
>         Attachments: OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Srinivasa (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Srinivasa updated OPENJPA-175:
------------------------------


1 - Yes, was planning to do it as a separate JIRA given that it directly does not concern the issue raised here, however I will include it here since we are introducing the in-clause limit in the DBDictionary for this fix.
2 - Looks fine to me, except for the minor issue that in the (size <= batch * 2) case we will not be adhering to the FetchBatchSize for pageSize in that the first in-clause query will be for lesser than the FetchBatchSize number of entries, however we will still endup running the same number of in-clause queries - 2.

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa
>         Attachments: OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Abe White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482821 ] 

Abe White commented on OPENJPA-175:
-----------------------------------

I'll have to see the code in context once it's checked in because I'm not very good at reading patches, but it looks good to me.

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa
>         Attachments: OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Srinivasa (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Srinivasa updated OPENJPA-175:
------------------------------

    Attachment: InExpression-Diff.txt

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa
>         Attachments: InExpression-Diff.txt, OPENJPA-175-patch.txt, OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-175) Eager selects by PagingResultObjectProvider may not use the FetchBatchSize

Posted by "Srinivasa Segu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Srinivasa Segu updated OPENJPA-175:
-----------------------------------

    Attachment: OPENJPA-175-patch.txt

> Eager selects by PagingResultObjectProvider may not use the FetchBatchSize
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-175
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-175
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Srinivasa Segu
>         Attachments: OPENJPA-175-patch.txt
>
>
> The PagingResultObjectProvider during initialization does checks to determine the appropriate pageSize. While this logic caps the size to 50 and addresses determining an appropriate page size, it doesn't always conform to the set batch size. For example with the size being 1000 and FetchBatchSize set to say 500, the page size is determined to be 50 resulting in eager selects happening in batches of 50 when the user expects it to be in batches of 500. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.