title: Keep getting java.sql.SQLFeatureNotSupportedException error on my jpql
body: <p>Keep getting this error when I try to fetch all records for an entity from the database.</p>
  
  <pre><code>[err] javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgPreparedStatement.getLargeUpdateCount is not yet implemented.
  Error Code: 0
  Query: ReadAllQuery(referenceClass=Vehicle sql="VEHICLE_ID", "NAME" FROM "VEHICLES"")
  [err]   at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:389)
  [err]   at [internal classes]
  [err]   at com.ibm.op.model.control.vehicles.VehicleScheduler.retrieveVehiclesAtStartUp(VehicleScheduler.java:74)
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [err]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [err]   at java.lang.reflect.Method.invoke(Method.java:498)
  [err]   at com.ibm.ejs.container.EJSContainer.invokeProceed(EJSContainer.java:4870)
  [err]   at [internal classes]
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [err]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [err]   at java.lang.reflect.Method.invoke(Method.java:498)
  [err]   at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:200)
  [err]   at [internal classes]
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [err]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [err]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [err]   at java.lang.reflect.Method.invoke(Method.java:498)
  [err]   at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:200)
  [err]   at [internal classes]
  [err]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  [err]   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  [err]   at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>@Table(name="\"VEHICLES\"")
  @Entity
  public class Vehicle {
  
      @Id
      @NotNull
      @Column(name="\"VEHICLE_ID\"")
      private Long id;
  
  
      @NotNull
      @Column(name="\"NAME\"")
      private String name;
  
      //... Getters and setters
  }
  
  @Stateless
  public class VehicleScheduler{
  
      @PersistenceContext
      private EntityManager entityManager;
  
  
      @PostConstruct
      public void retrieveVehiclesAtStartUp() {
          try {
              List&lt;Vehicle&gt; vehicles = this.entityManager
                  .createQuery("SELECT v FROM Vehicle v", Vehicle.class)
                  .getResultList();
              vehicles.forEach((vehicle) -&gt; {
                  System.out.println("We got new vehicle " + vehicle.getId());
              });
          } catch(Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Here's the persistence.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"&gt;
      &lt;persistence-unit name="local" transaction-type="JTA"&gt;
          &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
          &lt;jta-data-source&gt;jdbc/postgres&lt;/jta-data-source&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Where <code>jdbc/postgres</code> is the jndi lookup name that we configure in the websphere-liberty server.xml file. I am using jpa-2.2, eclipselink-2.7.1, postgresql-42.2.2.jar for jdbc driver and postgresql-9.6 database server.The list of features in server.xml is </p>
  
  <pre><code>   &lt;featureManager&gt;
          &lt;feature&gt;beanValidation-2.0&lt;/feature&gt;
          &lt;feature&gt;cdi-2.0&lt;/feature&gt;
          &lt;feature&gt;appSecurity-3.0&lt;/feature&gt;
          &lt;feature&gt;j2eeManagement-1.1&lt;/feature&gt;
          &lt;feature&gt;wasJmsServer-1.0&lt;/feature&gt;
          &lt;feature&gt;jaxrs-2.1&lt;/feature&gt;
          &lt;feature&gt;webProfile-8.0&lt;/feature&gt;
          &lt;feature&gt;jcaInboundSecurity-1.0&lt;/feature&gt;
          &lt;feature&gt;jsonb-1.0&lt;/feature&gt;
          &lt;feature&gt;managedBeans-1.0&lt;/feature&gt;
          &lt;feature&gt;ejbHome-3.2&lt;/feature&gt;
          &lt;feature&gt;jaxws-2.2&lt;/feature&gt;
          &lt;feature&gt;jsonp-1.1&lt;/feature&gt;
          &lt;feature&gt;jaxrsClient-2.1&lt;/feature&gt;
          &lt;feature&gt;el-3.0&lt;/feature&gt;
          &lt;feature&gt;concurrent-1.0&lt;/feature&gt;
          &lt;feature&gt;appClientSupport-1.0&lt;/feature&gt;
          &lt;feature&gt;ejbRemote-3.2&lt;/feature&gt;
          &lt;feature&gt;jaxb-2.2&lt;/feature&gt;
          &lt;feature&gt;mdb-3.2&lt;/feature&gt;
          &lt;feature&gt;jacc-1.5&lt;/feature&gt;
          &lt;feature&gt;batch-1.0&lt;/feature&gt;
          &lt;feature&gt;json-1.0&lt;/feature&gt;
          &lt;feature&gt;jaspic-1.1&lt;/feature&gt;
          &lt;feature&gt;distributedMap-1.0&lt;/feature&gt;
          &lt;feature&gt;websocket-1.1&lt;/feature&gt;
          &lt;feature&gt;wasJmsSecurity-1.0&lt;/feature&gt;
          &lt;feature&gt;wasJmsClient-2.0&lt;/feature&gt;
          &lt;feature&gt;ejbLite-3.2&lt;/feature&gt;
          &lt;feature&gt;localConnector-1.0&lt;/feature&gt;
          &lt;feature&gt;jdbc-4.2&lt;/feature&gt;
          &lt;feature&gt;jpa-2.2&lt;/feature&gt;
          &lt;feature&gt;jndi-1.0&lt;/feature&gt;
          &lt;feature&gt;jpaContainer-2.2&lt;/feature&gt;
      &lt;/featureManager&gt;
  </code></pre>
  
  <p>What am I doing wrong? Why is the JPQL query not executing correctly?</p>
  
  <p>I did find this in the websphere liberty profile logs</p>
  
  <pre><code>Exception = java.sql.SQLFeatureNotSupportedException
  Source = com.ibm.ws.rsadapter.jdbc.v42.WSJdbc42PreparedStatement.closeWrapper
  probeid = 310
  Stack Dump = java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgPreparedStatement.getLargeUpdateCount is not yet implemented.
      at org.postgresql.Driver.notImplemented(Driver.java:683)
      at org.postgresql.jdbc.PgStatement.getLargeUpdateCount(PgStatement.java:998)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.postgresql.ds.PGPooledConnection$StatementHandler.invoke(PGPooledConnection.java:428)
      at com.sun.proxy.$Proxy90.getLargeUpdateCount(Unknown Source)
      at com.ibm.ws.rsadapter.jdbc.v42.WSJdbc42PreparedStatement.getCompatibleUpdateCount(WSJdbc42PreparedStatement.java:51)
      at com.ibm.ws.rsadapter.impl.DatabaseHelper.getUpdateCount(DatabaseHelper.java:336)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.closeWrapper(WSJdbcPreparedStatement.java:306)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:152)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:110)
      at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeStatement(DatabaseAccessor.java:414)
      at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.releaseStatement(DatabaseAccessor.java:1700)
      at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:709)
      at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:564)
      at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2093)
      at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:600)
      at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:270)
      at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:256)
      at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:327)
      at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:722)
      at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2740)
      at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2693)
      at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:563)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1221)
      at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1180)
      at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:464)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1268)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2979)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1892)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1874)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
      at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:260)
      at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
      at com.ibm.op.model.control.vehicles.VehicleScheduler.retrieveVehiclesAtStartUp(VehicleScheduler.java:74)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.ibm.ejs.container.EJSContainer.invokeProceed(EJSContainer.java:4870)
      at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:651)
      at com.ibm.ws.cdi.ejb.impl.InterceptorChain.proceed(InterceptorChain.java:119)
      at com.ibm.ws.cdi.ejb.impl.EJBCDIInterceptorWrapper.invokeInterceptors(EJBCDIInterceptorWrapper.java:131)
      at com.ibm.ws.cdi.ejb.impl.EJBCDIInterceptorWrapper.aroundTimeout(EJBCDIInterceptorWrapper.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:200)
      at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:631)
      at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
      at com.ibm.ws.cdi.ejb.interceptor.WeldSessionBeanInterceptorWrapper.aroundInvoke(WeldSessionBeanInterceptorWrapper.java:58)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:200)
      at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:631)
      at com.ibm.ejs.container.interceptors.InvocationContextImpl.doAroundInterceptor(InvocationContextImpl.java:305)
      at com.ibm.ejs.container.interceptors.InvocationContextImpl.doAroundInvoke(InvocationContextImpl.java:272)
      at com.ibm.ejs.container.EJSContainer.invoke(EJSContainer.java:4772)
      at com.ibm.ejs.container.TimedObjectWrapper.invokeCallback(TimedObjectWrapper.java:87)
      at com.ibm.ejs.container.TimerNpRunnable.doWork(TimerNpRunnable.java:195)
      at com.ibm.ejs.container.TimerNpRunnable.run(TimerNpRunnable.java:102)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>