-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Serious Perfromance degradation with MS SQL
PostPosted: Tue May 10, 2016 8:03 am 
I could fix my similar issue by adding
Code:
OPTION (RECOMPILE)
to my query.
See https://msdn.microsoft.com/en-us/library/ms181714.aspx
I sneak them into the Query by getting the CriteriaImpl via reflection and calling .setQueryHint("RECOMPILE")

and the QueryHint is later added to the SQL String via an extended jTDS Driver that implements the

Code:
   public String getQueryHintString(String query, List<String> hints) {
      StringBuilder out = new StringBuilder(query);
      for(String hint: hints) {
         out.append("\n ").append("OPTION (").append(hint).append(")");
      }
      return out.toString();
   }


Hope it helps someone.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.