Uploaded image for project: 'Hibernate ORM'
  1. HHH-9929

javax.persistence.query.timeout hint is not fully supported

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 4.3.10
    • Fix Version/s: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      From what I understand, this hint is supposed to be propagated from the EntityManager to all queries and ORM operations executed by that EntityManager.

      At present, the hint is only propagated to queries created using createQuery(String), and not to queries created using any other create*Query method, nor to any ORM operations, like find() and so on.

      It's clear in the code why this is so. The createQuery(String) method calls applyProperties(Query) to apply hints to the query, whereas createQuery(String, Class) does not:

      org.hibernate.jpa.spi.AbstractEntityManagerImpl.java
      	@Override
      	public Query createQuery(String jpaqlString) {
      		checkOpen();
      		try {
      			return applyProperties( new QueryImpl<Object>( internalGetSession().createQuery( jpaqlString ), this ) );
      		}
      		catch ( RuntimeException e ) {
      			throw convert( e );
      		}
      	}
      
      	protected abstract void checkOpen();
      
      	@Override
      	public <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass) {
      		checkOpen();
      		try {
      			// do the translation
      			org.hibernate.Query hqlQuery = internalGetSession().createQuery( jpaqlString );
      
      			resultClassChecking( resultClass, hqlQuery );
      
      			// finally, build/return the query instance
      			return new QueryImpl<T>( hqlQuery, this );
      		}
      		catch ( RuntimeException e ) {
      			throw convert( e );
      		}
      	}
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: