[
https://issues.apache.org/jira/browse/OPENJPA-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110032#comment-18110032
]
ASF subversion and git services commented on OPENJPA-2986:
----------------------------------------------------------
Commit fed9dd1a5e38f3e1b45e1ac5efc14273842f2336 in openjpa's branch
refs/heads/OPENJPA-2986 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=fed9dd1a5 ]
[OPENJPA-2986] Report the timeout only when one is set on the query
Review feedback: getTimeout() derived null from the effective value being
non positive, so an explicit setTimeout(0) read back as null while a query
that merely inherited a timeout reported one. It now reports null when no
timeout is set on the query itself, and the effective value otherwise.
setTimeout(null) drops the recorded hint instead of re-recording the
inherited value, so a cleared timeout no longer shows up in getHints() and
no longer outranks a later openjpa.FetchPlan.QueryTimeout hint.
Also corrects the javadoc: a null timeout clears the timeout whatever set
it, not only one set through this method, and restores the value the entity
manager carries at that point rather than the one the query was created
with.
> setTimeout(null) cannot clear a previously set query timeout
> ------------------------------------------------------------
>
> Key: OPENJPA-2986
> URL: https://issues.apache.org/jira/browse/OPENJPA-2986
> Project: OpenJPA
> Issue Type: Sub-task
> Components: jpa
> Affects Versions: 4.2.0
> Reporter: Maxim Solodovnik
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3683006065
> **(low)** `setTimeout(null)` is silently ignored, so once a timeout is set it
> can never be cleared through this API (and `getTimeout()` keeps returning the
> stale value). Should null reset the fetch plan's query timeout to its
> default?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)