Opened 10 years ago

Closed 10 years ago

#920 closed enhancement (fixed)

Add support for aborting queries using a StatlessSession

Reported by: nicklas Owned by: nicklas
Priority: minor Milestone: BASE 2.7
Component: core Version:
Keywords: Cc:

Description

Many of our performance-sensitive queries use a StatelessSession? since that has lower overhead. A drawback is that we can't add support for aborting this kind of queries since there is no StatelessSession?.cancelQuery() method. I have posted a question about this in the Hibernate forums. Hopefully, they will implement it in the future and we can fix this ticket.

See http://forum.hibernate.org/viewtopic.php?t=983499&start=0&postdays=0&postorder=asc&highlight=

Change History (2)

comment:1 Changed 10 years ago by nicklas

  • Milestone changed from BASE 2.x+ to BASE 2.7
  • Owner changed from everyone to nicklas
  • Status changed from new to assigned

The StatlessSessionImpl has public methods that we can use to cancel the query: getBatcher().cancelLastQuery(). So a workaround is to cast the StatelessSession to StatelessSessionImpl. The risk we are running is that the implementation may change in the future since it is strictly speaking not part of the public Hibernate API.

comment:2 Changed 10 years ago by nicklas

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4243]) Fixes #920: Add support for aborting queries using a StatlessSession?

Note: See TracTickets for help on using tickets.