You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Donald Woods (JIRA)" <ji...@apache.org> on 2009/01/29 19:12:59 UTC

[jira] Created: (OPENJPA-878) Support default query hint for query timeout

Support default query hint for query timeout
--------------------------------------------

                 Key: OPENJPA-878
                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
             Project: OpenJPA
          Issue Type: Sub-task
          Components: query
    Affects Versions: 2.0.0
            Reporter: Donald Woods
            Assignee: Donald Woods
             Fix For: 2.0.0




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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-docs-20090311.patch

Patch to add definitions for javax.persistence.lock.timeout and javax.persistence.query.timeout to the 10.1.7 Query Hints section.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681896#action_12681896 ] 

Jeremy Bauer commented on OPENJPA-878:
--------------------------------------

Comments on OPENJPA-878-20090313.patch:

Pinaki's suggestion was very good, IMHO.  This version looks much cleaner and allows for database specific behavior.  I was going to suggest eliminating the near duplicate set methods in DBDictionary with a single method that takes both timeout values as int params - but passing in the fetch config or jdbc config will allow simpler setting of future timeout values (if any should get added), without needing to modify all the setTimeouts method calls in the code.  Unless there is an objection, I'll commit this patch (with formatting updates) on 3/16.  That should provide ample time for others to review.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090305-draft.patch

Draft patch that implements Query timeout support.
So far, only tested on Derby.  Also, still have a couple cleanup TODOs, but wanted to post it to get some early feedback.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Assigned: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods reassigned OPENJPA-878:
------------------------------------

    Assignee: Jeremy Bauer  (was: Donald Woods)

The following requested updates are ready for your review -
OPENJPA-878-DBDictionary.patch - changes requested by Milosz
OPENJPA-878-TestQueryTimeout.patch - changes requested by Jeremy
OPENJPA-878-serialVersionUID.patch - changes requested by Pinaki

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Jeremy Bauer
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Jeremy Bauer updated OPENJPA-878:
---------------------------------

    Parent Issue: OPENJPA-956  (was: OPENJPA-875)

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Work started: (OPENJPA-878) Support default query hint for query timeout

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

Work on OPENJPA-878 started by Donald Woods.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090310.patch
                OPENJPA-878-20090310-eclipse.patch

Updated patches that do not change the method signatures.
I've attached both a svn diff and Subclipse version of the patch, as the svn diff version includes replacing Windows EOL on 2 files.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090306.patch

Updated patch that only runs the junit tests only against Derby for now.
Additional JIRAs 963 and 964 opened against I5 to complete test coverage items.
EntityManagerImpl.java changes backed out.
JPA 2.0 spec comments removed from FetchConfiguration.java and OpenJPAConfiguration.java.
Usage of QueryTimeoutException.isFatal() not addressed, as the code matches what was done for lock timeouts.
Method signature changes not addressed, as these were required to enable access to the queryTimeout value.
Only reformatted TestQueryTimeout.java to 80 columns (using the 'where required' option in Eclipse.)


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090311-eclipse.patch

Updated patch against Rev752306 which fixes the existing org.apache.openjpa.conf.TestQueryHints junit test, which was using getQueryTimeout() for lockTimeout comparison.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679624#action_12679624 ] 

Jeremy Bauer commented on OPENJPA-878:
--------------------------------------

Comments on OPENJPA-878-20090305-draft.patch:

- General: OpenJPA uses an 80 column, 4 space indent formatting scheme  some lines were considerably longer than 80 chars.
- General: Looks like there is a lot of work to identify the query timeout condition for all the supported DBs...  We could consider making that a separate work item.

- FetchConfiguration.java and OpenJPAConfiguration.java are in the kernel module.  The kernel can be & is used by multiple ORM providers/solutions so kernel javadoc should not be specific to JPA.  I recommend removing the JPA 2.0 spec ... line.

- SQLBuffer.java - I could be mistaken, but I don't think removing a public method or changing a method signature is a good idea.  Fay is more knowledgeable on the external uses of this class so it would be be good run these changes by her. 
- It looked as if OpenJPA was only passing the fetch config when dealing with LRS.  Are there any additional side effects from passing the fetch config?  Does any behavior get triggered that should be LRS only by passing the fetch config on the prepare?

- JDBCStoreQuery.java - ditto on the method signature changes

- TableJDBCSeq.java - I'd like to see some feedback from other folks regarding the use of query timeout during this sensitive operation.  The sequence operation is part of the full operation so I think it makes sense to try to honor the timeout, if possible.  Although a separate work item, I think lock timeout should also be considered.

SQLStoreQuery.java - ditto on the method signature changes

TableSchemaFactory.java - IMHO, I don't think we should honor timeouts in the schema factory.  That's startup behavior vs. runtime behavior and I think this hint would be more expected to apply only to runtime behavior.  It would be good to have other opinions on this as well.

EntityManagerImpl.java - The changes to the clear method were part of Dianne's patch, but shouldn't have been in the patch.

TestQueryTimeout .java -  I noticed that the ability to retry an operation after a query timeout is database specific.  Could/should this fact get carried into QueryTimeoutException.isFatal()?  

Very thorough job on the tests!


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681031#action_12681031 ] 

Pinaki Poddar commented on OPENJPA-878:
---------------------------------------

The key changes are not very visible in OPENJPA-878-20090311.patch because often they are masked by large diffs created by EOL/white space character mismatch.
So
1. Create a patch that does have the real changes (e.g. something like svn diff -x --ignore-all-space)
2. Submit separate patch for source and test branches. Actually, the tests can be directly checked-in.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Assigned: (OPENJPA-878) Support default query hint for query timeout

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

Jeremy Bauer reassigned OPENJPA-878:
------------------------------------

    Assignee: Donald Woods  (was: Jeremy Bauer)

Committed OPENJPA-878-TestQueryTimeout.patch for Donald under revision 755818.
Committed OPENJPA-878-DBDictionary.patch for Donald under revision 755819.

The issue regarding the use of serialVersionUID will be resolved under another JIRA.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

          Component/s: query
        Fix Version/s: 2.0.0
          Description: Support default query hint for query timeout as defined in section 3.6.4 of the spec.
    Affects Version/s: 2.0.0

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681365#action_12681365 ] 

Jeremy Bauer commented on OPENJPA-878:
--------------------------------------

Couple of comments on OPENJPA-878-20090311.patch (7:12pm).

1) There is quite a bit of duplication of the setTimeout method (likely caused by refactoring to eliminate the need for interface changes per previous comments) across multiple subclasses.  Is it possible to implement the method in the abstract parent class (for store query, seq, and strats) to eliminate much of the duplication?

or 

2) Similar to connection, could a decorator pattern be applied to prepared statement to decorate the ps with query and lock timeout  hints vs. calling it explicitly after a statement is constructed?  This may be difficult depending on the availability of the configuration.  Something to think about though.

3) The code uses 'max' to calculate the timeout value when query & lock timeout are used in combination.  Given the way lock timeouts are currently implemented (with query timeout), that seems like the safest behavior. (Other opinions?)  Until lock timeouts are handled by the DB, I think this behavior should be documented.  A sentence in the lock and query timeout docs would be sufficient.

4) Should query timeout be applied to sequence queries?  I'm on the fence.  Any thoughts on this?

Is anyone opposed to including the FIXME comments when these changes are committed?  They reference another JIRA so they aren't simply 'dangling' out there.  Is there a convention for commenting on future work within code?  Should those comments only exist within a JIRA?

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Issue Comment Edited: (OPENJPA-878) Support default query hint for query timeout

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681884#action_12681884 ] 

Donald Woods edited comment on OPENJPA-878 at 3/13/09 1:14 PM:
---------------------------------------------------------------

Updated patch (OPENJPA-878-20090313.patch) that addresses Pinaki's request to centralize the set query/lock timeout code into the DBDictionary.


      was (Author: drwoods):
    Updated patch that addresses Pinaki's request to centralize the set query/lock timeout code into the DBDictionary.

  
> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090312-minimal.patch

Updated patch (OPENJPA-878-20090312-minimal.patch) that addresses Jeremy's #1 and #4 concerns by removing setTimeout() on seq/schema/counts/DBDictionary/... and only implements it on SelectImpl and SQLStoreQuery, so the TestQueryTimeout tests will still pass for the Spec required EM.find()/executeUpdate(), getResultList() and getSingleResult() operations.
Includes base QueryTimeoutException support with required updates to sql-error-codes.xml, StoreException, QueryException and DBDictionary/DerbyDictionary.
Includes doc updates to include new Query/Lock timeout hint definitions.
Still uses max() if a LockTimeout is specified, until OPENJPA-957 is resolved.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090313.patch

Updated patch that addresses Pinaki's request to centralize the set query/lock timeout code into the DBDictionary.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681406#action_12681406 ] 

Pinaki Poddar commented on OPENJPA-878:
---------------------------------------

The very fact that following code (or similar variants) appears 10+ times in the patch points that a better solution/refactoring is required. 
It is not about that the patch is getting it wrong (in fact, the patch shows thoroughness) but the way existing things are. 

Given that
1) the research finds that time outs may better be handled database server side
2) JDBC does not support a lockTimeOut and we are emulating it by query time out
3) databases employ specific techniques for server side time outs
4) the current timeout requires us to duplicate same code block +10 times
 
I suggest
a) move the duplicated code to DBDictionary -- this default implement will do what we do today i.e. emulate locktimeout via querytimeout.
this will remove/minimize duplication of code and will localize the timeout function at one place
b) incrementally add specific database time out functions for server side time out



+    protected void setTimeout(PreparedStatement stmnt, JDBCStore store,
+        JDBCFetchConfiguration fetch)
+        throws SQLException {
+        if (store.getDBDictionary().supportsQueryTimeout) {
+            int timeout = fetch.getQueryTimeout();
+            if (timeout >= 0) {
+                if (timeout > 0 && timeout < 1000) {
+                    timeout = 1000; 
+                    Log log = store.getConfiguration().getLog(JDBCConfiguration.LOG_JDBC);
+                    if (log.isWarnEnabled())
+                        log.warn(_loc.get("millis-query-timeout"));
+                }
+                stmnt.setQueryTimeout(timeout / 1000);
+            }
+        }
+    }
+    


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Description: 
Support default query hint for query timeout as defined in section 3.6.4 of the spec.
A new hint can be supplied for Java SE and Java EE environments -
    javax.persistence.query.timeout // query timeout in seconds
Can be used in the following:
    Methods - Query.setHint()
    Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
    Properties - Persistence.createEntityManagerFactory, persistence.xml
The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).


  was:Support default query hint for query timeout as defined in section 3.6.4 of the spec.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OpenJPA-878-db2.zip

Code to setup DB2 for setQueryTimeout testing with TestQueryTimeout.java junit code.
First, create a DB called OPENJPA and make sure you have uid=db2admin setup.
Then, run DelaySetup.bat (which uses uid=db2admin) to create the jar with the delay() function, register the jar in DB2 and create a Delay function on the OPENJPA db.
I've been testing this with DB2 v9.5 on Windows, but it should work for 9.1 and v8.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OpenJPA-878-db2.zip, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671906#action_12671906 ] 

Donald Woods commented on OPENJPA-878:
--------------------------------------

A new hint can be supplied -
    javax.persistence.query.timeout     // time in seconds
Can be used in the following:
    Methods - Query.setHint()
    Annotations - NamedQuery, NativeNamedQuery
    Properties - Persistence.createEntityManagerFactory, persistence.xml
The following methods can return a javax.persistence.QueryTimeoutException:  getResultList(), getSingleResult(), executeUpdate().
If a QTE is thrown, the current transaction (if active) should not be marked for rollback.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OpenJPA-878-db2.tgz

DB2 for Linux setup scripts for testing.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OpenJPA-878-db2.tgz, OpenJPA-878-db2.zip, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090311.patch
                OPENJPA-878-20090311-eclipse.patch

Updated Eclipse patch that can be applied to existing trunk subprojects.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Resolved: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods resolved OPENJPA-878.
----------------------------------

    Resolution: Fixed

Remaining suggestion to fix serialVersionUID usage has been opened as OPENJPA-1000.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OpenJPA-878-db2.zip, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681376#action_12681376 ] 

Donald Woods commented on OPENJPA-878:
--------------------------------------

I'll take a look at #1/#2 to see what can be done, but there were several abstract interfaces being used that didn't extend a common parent (and I was afraid of breaking APIs again.)
For #3, I'll add a comment in OPENJPA-957, to update the docs if we don't end up switching to use the db server lock timeout support.
For #4, my thoughts were that if someone provides a query.timeout value/hint, then we should try to honor it everywhere, as the usage of setQueryTimeout() is to prevent JDBC client apps from waiting forever on blocked or missed server responses due to network or db problems.
For the FIXME, I noticed in Eclipse there were tons of existing FIXME/TODO comment tags, so I also used it to denote pending work items....

Thanks for the review.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679668#action_12679668 ] 

Donald Woods commented on OPENJPA-878:
--------------------------------------

Thanks for the review.
Yep, figured someone would catch the formatting, as I hate the 20+ year old standard of 80 column widths, given most everyone has hi-res wide screen displays now...  I can fix this in my Eclipse settings for the next patch.

For the other DBs, I'd like to open a subtask for I5.  I would also like to include additional tests for setting the property via Persistence.createEntityManagerFactory and persistence.xml in I5.

The method signature changes were the only way to get the queryTimeout value down into the prepareStatement() and prepareCall() methods, as they currently only have access to the Connection, which doesn't have handles to the FetchConfiguration or OpenJPAConfiguration classes.

Adding queryTimeout support to TableJDBCSeq.java would involve either more method signature changes and/or creating a FetchConfiguration just to hold the QueryTimeout value if it is > 0, as neither the TableJDBCSeq nor TableSchemaFactory classes have a FetchConfiguration passed to them today (but they do have access to the OpenJPAConfiguration data.)


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Comment: was deleted

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment:     (was: OPENJPA-878-20090311-eclipse.patch)

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-20090311.patch

Updated the OPENJPA-878-20090311.patch by using "svn diff -x --ignore-eol-style".  Pinaki, thanks for the pointer.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Jeremy Bauer updated OPENJPA-878:
---------------------------------

    Parent Issue: OPENJPA-875  (was: OPENJPA-808)

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682558#action_12682558 ] 

Jeremy Bauer commented on OPENJPA-878:
--------------------------------------

Committed OPENJPA-878-20090313.patch (with updates) under revisions: 755113, 755114, 755115, 755116, 755117 for Donald.

Comments:
- Cleaned up unused localizers per suggestion from Milosz
- Did not remove usage of 'this' in new dictionary methods per suggestion from Milosz.  I'll catch that on the next update.
- Tagged two methods in TestQueryTimeout with AllowFailure(true) because they fail intermittently on my local build (but ran fine on a separate build server).  I've sent the surefire report to Donald for investigation.  Failures look to be test procedure related.

 

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-TestQueryTimeout.patch
                OPENJPA-878-DBDictionary.patch

Attached patch (OPENJPA-878-DBDictionary.patch) to address Milosz's request to remove the "this." usage from DBDictionary.
Attached patch (OPENJPA-878-TestQueryTimeout.patch) to address Jeremy's intermittent test failures on Windows.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Commented: (OPENJPA-878) Support default query hint for query timeout

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682021#action_12682021 ] 

Milosz Tylenda commented on OPENJPA-878:
----------------------------------------

Jeremy, as for performing formatting changes I noticed two little things in the patch:
- in DBDictionary, from what I have seen, we usually don't use "this" in front of variable unless necessary,
- probably there are some unused Localizers.


> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-docs-20090311.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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


[jira] Updated: (OPENJPA-878) Support default query hint for query timeout

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

Donald Woods updated OPENJPA-878:
---------------------------------

    Attachment: OPENJPA-878-serialVersionUID.patch

Patch (OPENJPA-878-serialVersionUID.patch) that removes serialVersionUID additions, as requested by Pinaki.

> Support default query hint for query timeout
> --------------------------------------------
>
>                 Key: OPENJPA-878
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-878
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-878-20090305-draft.patch, OPENJPA-878-20090306.patch, OPENJPA-878-20090310-eclipse.patch, OPENJPA-878-20090310.patch, OPENJPA-878-20090311-eclipse.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090311.patch, OPENJPA-878-20090312-minimal.patch, OPENJPA-878-20090313.patch, OPENJPA-878-DBDictionary.patch, OPENJPA-878-docs-20090311.patch, OPENJPA-878-serialVersionUID.patch, OPENJPA-878-TestQueryTimeout.patch
>
>
> Support default query hint for query timeout as defined in section 3.6.4 of the spec.
> A new hint can be supplied for Java SE and Java EE environments -
>     javax.persistence.query.timeout // query timeout in seconds
> Can be used in the following:
>     Methods - Query.setHint()
>     Annotations (via QueryHint) - NamedQuery, NativeNamedQuery 
>     Properties - Persistence.createEntityManagerFactory, persistence.xml
> The following methods can return a javax.persistence.QueryTimeoutException: getResultList(), getSingleResult(), executeUpdate().
> If a QTE is thrown, the current transaction (if active) should not be marked for rollback.
> If the DB query timeout causes a rollback, then a PersistenceException should be thrown instead (see 3.6.1).

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