Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Bug 456067 - javax.persistence.query.timeout

I agree, if the implementation observes the hint it should conform to the format.

On 13.01.15 17:19, Rick Curtis wrote:
My vote is that this is a bug and it wasn't a conscious deviation from the spec. In the final version of the JPA-2.0 spec this property is defined as "javax.persistence.query.timeout // time in milliseconds". If you dig a bit deeper into spec history and look at an early draft version[1] you will find the following:

javax.persistence.lock.timeout // time in seconds
Open Issue: Whether units should be seconds or milliseconds

I suspect what happened is that this hint was implemented prior to the spec coming to a decision on seconds vs milliseconds. Once the decision was made to use milliseconds, the runtime was never updated. While it is true that JDBC under the covers doesn't handle milliseconds, I don't think that drove the decision of this implementation. (Someone please correct me if I'm wrong)

Now that we understand how we got to where we are, what to do? In my eyes this is a spec compliance issue vs existing user situation. My vote is to update the hint to (only on trunk, leave existing branches/releases alone) adhere to the spec and add a property that will allow existing users to get the old behavior back.




On Mon, Jan 12, 2015 at 10:09 AM, William Dazey <dazeydev.3@xxxxxxxxx <mailto:dazeydev.3@xxxxxxxxx>> wrote:

    I was looking over this reported bug in DatabaseCall class and
    wanted to see if someone could weight-in on the reason for using
    Seconds rather than Milliseconds as indicated in the 2.0 spec?
    After looking over the code and spec, it seems the property is
    provider dependent. I'm thinking EclipseLink chose to use Seconds
    since it is the unit of time that
    java.sql.Statement.setQueryTimeout(int seconds) assumes you are
    passing. I could write up a patch that would add support for any
    duration by adding a new property, but the user still would have
    to understand that in the end, whole seconds are being used as the
    timeout duration and fractional seconds will be rounded. Is this
    support necessary? Thoughts?

    eclipselink-dev mailing list
    eclipselink-dev@xxxxxxxxxxx <mailto:eclipselink-dev@xxxxxxxxxxx>
    To change your delivery options, retrieve your password, or
    unsubscribe from this list, visit

*Rick Curtis*

Martin Grebac, SW Engineering Manager
Oracle Czech, Prague

Back to the top