title: Why is there "pool pool-1-thread-1" exception in Thread
body: <p>The following code:</p>
  
  <pre><code>ExecutorService executor = newSingleThreadExecutor();
  executor.execute(new Runnable()
              {
                  @Override
                  public void run()
                  {
                      Session session = (Session) entityManager.getDelegate();
                      SQLQuery query = session.createSQLQuery("SELECT * FROM function()");
                      boolean result= (boolean) query.uniqueResult();
                  }
              }
  </code></pre>
  
  <p>I get an exception :</p>
  
  <pre><code>Exception in thread "pool-1-thread-1" java.lang.NullPointerException
      at personDao$1.run(PersonDao.java:1080)
  </code></pre>
  
  <p>So it says on the line where <code>boolean result= (boolean) query.getUniqueResult();</code>, there is an pool 1 thread 1, why is this happening? </p>