pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
26+ messages / 16 participants
[nested] [flat]

* org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
@ 2005-07-19 08:56 Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
  2005-07-19 10:47 ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block im i <linimi@gmail.com>
  2005-07-19 12:16 ` Re: org.postgresql.util.PSQLException: ERROR: current transaction Oliver Jowett <oliver@opencloud.com>
  0 siblings, 2 replies; 26+ messages in thread

From: Senthoorkumaran Punniamoorthy @ 2005-07-19 08:56 UTC (permalink / raw)
  To: pgsql-jdbc

We are using postgres as our DB for our application based on EJB. I am
using the pg74.216.jdbc3.jar driver.

one of the EJB-QL in the finder method translates to a query in JBoss as 

Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
t0_o WHERE (t0_o.userId = ?)

This query works on the postgres command line interface fine. 

SELECT t0_o.userId, t0_o.deviceId BEING_VAULT=# SELECT t0_o.userId,
t0_o.deviceId FROM rcp_user_device t0_o WHERE (t0_o.userId =
'94773059650')
BEING_VAULT-# ;
   userid    |    deviceid     
-------------+-----------------
 94773059650 | 351532002206818
(1 row)

However JDBC driver is rasing an exception, and below is the stack trace. 

2005-07-19 12:14:54,506 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
t0_o WHERE (t0_o.userId = ?)
2005-07-19 12:14:54,509 ERROR
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
Find failed
org.postgresql.util.PSQLException: ERROR: current transaction is
aborted, commands ignored until end of transaction block

        at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
        at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
        at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
        at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:228)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:128)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:598)
        at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:322)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:321)
        at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:649)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
        at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
        at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:192)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
        at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
        at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:117)
        at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
        at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
        at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
        at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
        at org.jboss.ejb.Container.invoke(Container.java:894)
        at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
        at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
        at $Proxy279.findAllByUser(Unknown Source)
        at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.deleteUserDevices(UnsubscriptionSessionBean.java:176)
        at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.unsubscribe(UnsubscriptionSessionBean.java:147)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
        at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
        at org.jboss.ejb.Container.invoke(Container.java:873)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
        at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
        at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
        at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
        at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
        at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
        at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
        at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
        at $Proxy379.unsubscribe(Unknown Source)
        at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.removeOldUser(MsisdnUpdaterSessionBean.java:248)
        at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.updateWhereUserIdEqualsMsisdn(MsisdnUpdaterSessionBean.java:231)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
        at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
        at org.jboss.ejb.Container.invoke(Container.java:873)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
        at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
        at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
        at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
        at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
        at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
        at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
        at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
        at $Proxy361.updateWhereUserIdEqualsMsisdn(Unknown Source)
        at com.purpleace.ripple.contacts.serviceinterface.facade.ChangeMsisdnFacade.changeMsisdn(ChangeMsisdnFacade.java:44)
        at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.controller(ChangeMsisdnServelet.java:166)
        at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.newHandleRequest(ChangeMsisdnServelet.java:78)
        at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.doPost(ChangeMsisdnServelet.java:61)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at com.purpleace.ripple.contacts.web.servlets.RippleServlet.controller(RippleServlet.java:271)
        at com.purpleace.ripple.contacts.web.servlets.RippleServlet.parseString(RippleServlet.java:425)
        at com.purpleace.ripple.contacts.web.servlets.RippleServlet.handleRequest(RippleServlet.java:124)
        at com.purpleace.ripple.contacts.web.servlets.RippleServlet.doPost(RippleServlet.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.purpleace.ripple.contacts.web.filters.GlobalFilter.doFilter(GlobalFilter.java:37)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:534)

Can you help me identify this issue? 

Regards,
Senthoor



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
  2005-07-19 08:56 org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
@ 2005-07-19 10:47 ` im i <linimi@gmail.com>
  2005-07-20 01:24   ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
  1 sibling, 1 reply; 26+ messages in thread

From: im i @ 2005-07-19 10:47 UTC (permalink / raw)
  To: Senthoorkumaran Punniamoorthy <senthoor@gmail.com>; +Cc: pgsql-jdbc

Hi,

(Sorry my english.)

I think, the problem is not in query. There is other statement what
corrupt the transaction before query, example insert or update. The
postgres 8. solve the problem with savepoint, you can create savepoint
before critical statement and when error occured you need rollback to
savepoint:

http://www.postgresql.org/docs/8.0/interactive/sql-savepoint.html

When you catch exception then the transaction is corrupt alredy.

try {
    savepointName = this.getClass().getName() + "-" +
this.getClass().hashCode();
    savePoint = conn.setSavepoint(savepointName);
    stmt.execute();
} catch (SQLException sqle) {
    conn.rollback(savePoint);
}

linimi

On 7/19/05, Senthoorkumaran Punniamoorthy <senthoor@gmail.com> wrote:
> We are using postgres as our DB for our application based on EJB. I am
> using the pg74.216.jdbc3.jar driver.
> 
> one of the EJB-QL in the finder method translates to a query in JBoss as
> 
> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
> t0_o WHERE (t0_o.userId = ?)
> 
> This query works on the postgres command line interface fine.
> 
> SELECT t0_o.userId, t0_o.deviceId BEING_VAULT=# SELECT t0_o.userId,
> t0_o.deviceId FROM rcp_user_device t0_o WHERE (t0_o.userId =
> '94773059650')
> BEING_VAULT-# ;
>    userid    |    deviceid
> -------------+-----------------
>  94773059650 | 351532002206818
> (1 row)
> 
> However JDBC driver is rasing an exception, and below is the stack trace.
> 
> 2005-07-19 12:14:54,506 DEBUG
> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
> t0_o WHERE (t0_o.userId = ?)
> 2005-07-19 12:14:54,509 ERROR
> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> Find failed
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
> 
>         at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
>         at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
>         at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
>         at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
>         at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
>         at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
>         at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
>         at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:228)
>         at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:128)
>         at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
>         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:598)
>         at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:322)
>         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:321)
>         at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:649)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
>         at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
>         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
>         at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:192)
>         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
>         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
>         at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:117)
>         at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
>         at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
>         at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
>         at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
>         at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
>         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
>         at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
>         at org.jboss.ejb.Container.invoke(Container.java:894)
>         at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
>         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
>         at $Proxy279.findAllByUser(Unknown Source)
>         at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.deleteUserDevices(UnsubscriptionSessionBean.java:176)
>         at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.unsubscribe(UnsubscriptionSessionBean.java:147)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
>         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
>         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
>         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
>         at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
>         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
>         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
>         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
>         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
>         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
>         at org.jboss.ejb.Container.invoke(Container.java:873)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
>         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
>         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
>         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
>         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
>         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
>         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
>         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
>         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
>         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
>         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
>         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
>         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
>         at $Proxy379.unsubscribe(Unknown Source)
>         at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.removeOldUser(MsisdnUpdaterSessionBean.java:248)
>         at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.updateWhereUserIdEqualsMsisdn(MsisdnUpdaterSessionBean.java:231)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
>         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
>         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
>         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
>         at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
>         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
>         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
>         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
>         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
>         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
>         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
>         at org.jboss.ejb.Container.invoke(Container.java:873)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
>         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
>         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
>         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
>         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
>         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
>         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
>         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
>         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
>         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
>         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
>         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
>         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
>         at $Proxy361.updateWhereUserIdEqualsMsisdn(Unknown Source)
>         at com.purpleace.ripple.contacts.serviceinterface.facade.ChangeMsisdnFacade.changeMsisdn(ChangeMsisdnFacade.java:44)
>         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.controller(ChangeMsisdnServelet.java:166)
>         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.newHandleRequest(ChangeMsisdnServelet.java:78)
>         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.doPost(ChangeMsisdnServelet.java:61)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
>         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
>         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
>         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
>         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.controller(RippleServlet.java:271)
>         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.parseString(RippleServlet.java:425)
>         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.handleRequest(RippleServlet.java:124)
>         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.doPost(RippleServlet.java:70)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at com.purpleace.ripple.contacts.web.filters.GlobalFilter.doFilter(GlobalFilter.java:37)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
>         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
>         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
>         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
>         at java.lang.Thread.run(Thread.java:534)
> 
> Can you help me identify this issue?
> 
> Regards,
> Senthoor
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
  2005-07-19 08:56 org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
  2005-07-19 10:47 ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block im i <linimi@gmail.com>
@ 2005-07-20 01:24   ` Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
  2005-07-20 01:59     ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 26+ messages in thread

From: Senthoorkumaran Punniamoorthy @ 2005-07-20 01:24 UTC (permalink / raw)
  To: pgsql-jdbc

Thanks for responding. However the problem with using this approach
would be since we are using container managed transaction and
persistance (CMP) the application doesnt have control over how the
SQLs are issued and executed. All managed by Jboss. In situations like
this what could be a viable alternative?

Regards,
Senthoor

On 7/19/05, im i <linimi@gmail.com> wrote:
> Hi,
> 
> (Sorry my english.)
> 
> I think, the problem is not in query. There is other statement what
> corrupt the transaction before query, example insert or update. The
> postgres 8. solve the problem with savepoint, you can create savepoint
> before critical statement and when error occured you need rollback to
> savepoint:
> 
> http://www.postgresql.org/docs/8.0/interactive/sql-savepoint.html
> 
> When you catch exception then the transaction is corrupt alredy.
> 
> try {
>     savepointName = this.getClass().getName() + "-" +
> this.getClass().hashCode();
>     savePoint = conn.setSavepoint(savepointName);
>     stmt.execute();
> } catch (SQLException sqle) {
>     conn.rollback(savePoint);
> }
> 
> linimi
> 
> On 7/19/05, Senthoorkumaran Punniamoorthy <senthoor@gmail.com> wrote:
> > We are using postgres as our DB for our application based on EJB. I am
> > using the pg74.216.jdbc3.jar driver.
> >
> > one of the EJB-QL in the finder method translates to a query in JBoss as
> >
> > Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
> > t0_o WHERE (t0_o.userId = ?)
> >
> > This query works on the postgres command line interface fine.
> >
> > SELECT t0_o.userId, t0_o.deviceId BEING_VAULT=# SELECT t0_o.userId,
> > t0_o.deviceId FROM rcp_user_device t0_o WHERE (t0_o.userId =
> > '94773059650')
> > BEING_VAULT-# ;
> >    userid    |    deviceid
> > -------------+-----------------
> >  94773059650 | 351532002206818
> > (1 row)
> >
> > However JDBC driver is rasing an exception, and below is the stack trace.
> >
> > 2005-07-19 12:14:54,506 DEBUG
> > [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> > Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
> > t0_o WHERE (t0_o.userId = ?)
> > 2005-07-19 12:14:54,509 ERROR
> > [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> > Find failed
> > org.postgresql.util.PSQLException: ERROR: current transaction is
> > aborted, commands ignored until end of transaction block
> >
> >         at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
> >         at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
> >         at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
> >         at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
> >         at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
> >         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
> >         at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
> >         at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
> >         at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:228)
> >         at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:128)
> >         at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
> >         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:598)
> >         at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:322)
> >         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:321)
> >         at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:649)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
> >         at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
> >         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
> >         at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:192)
> >         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
> >         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
> >         at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:117)
> >         at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
> >         at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
> >         at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
> >         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
> >         at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
> >         at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
> >         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
> >         at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
> >         at org.jboss.ejb.Container.invoke(Container.java:894)
> >         at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
> >         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
> >         at $Proxy279.findAllByUser(Unknown Source)
> >         at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.deleteUserDevices(UnsubscriptionSessionBean.java:176)
> >         at com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean.unsubscribe(UnsubscriptionSessionBean.java:147)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
> >         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
> >         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
> >         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
> >         at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
> >         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
> >         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
> >         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
> >         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
> >         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
> >         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
> >         at org.jboss.ejb.Container.invoke(Container.java:873)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
> >         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
> >         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
> >         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
> >         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
> >         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
> >         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
> >         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
> >         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
> >         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
> >         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
> >         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
> >         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
> >         at $Proxy379.unsubscribe(Unknown Source)
> >         at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.removeOldUser(MsisdnUpdaterSessionBean.java:248)
> >         at com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.updateWhereUserIdEqualsMsisdn(MsisdnUpdaterSessionBean.java:231)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
> >         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
> >         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
> >         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
> >         at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
> >         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
> >         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
> >         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
> >         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
> >         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
> >         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
> >         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
> >         at org.jboss.ejb.Container.invoke(Container.java:873)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
> >         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
> >         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
> >         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
> >         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
> >         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
> >         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
> >         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
> >         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
> >         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
> >         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
> >         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
> >         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
> >         at $Proxy361.updateWhereUserIdEqualsMsisdn(Unknown Source)
> >         at com.purpleace.ripple.contacts.serviceinterface.facade.ChangeMsisdnFacade.changeMsisdn(ChangeMsisdnFacade.java:44)
> >         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.controller(ChangeMsisdnServelet.java:166)
> >         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.newHandleRequest(ChangeMsisdnServelet.java:78)
> >         at com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.doPost(ChangeMsisdnServelet.java:61)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
> >         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
> >         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
> >         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
> >         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.controller(RippleServlet.java:271)
> >         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.parseString(RippleServlet.java:425)
> >         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.handleRequest(RippleServlet.java:124)
> >         at com.purpleace.ripple.contacts.web.servlets.RippleServlet.doPost(RippleServlet.java:70)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >         at com.purpleace.ripple.contacts.web.filters.GlobalFilter.doFilter(GlobalFilter.java:37)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
> >         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> >         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> >         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
> >         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
> >         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
> >         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> >         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> >         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> >         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
> >         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
> >         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> >         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
> >         at java.lang.Thread.run(Thread.java:534)
> >
> > Can you help me identify this issue?
> >
> > Regards,
> > Senthoor
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> >
>



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
  2005-07-19 08:56 org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
  2005-07-19 10:47 ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block im i <linimi@gmail.com>
  2005-07-20 01:24   ` Re: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
@ 2005-07-20 01:59     ` Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 26+ messages in thread

From: Dave Cramer @ 2005-07-20 01:59 UTC (permalink / raw)
  To: Senthoorkumaran Punniamoorthy <senthoor@gmail.com>; +Cc: pgsql-jdbc

Somewhere before the query that threw the exception an error occured.

Fix that and this exception will go away.

Dave
On 19-Jul-05, at 9:24 PM, Senthoorkumaran Punniamoorthy wrote:

> Thanks for responding. However the problem with using this approach
> would be since we are using container managed transaction and
> persistance (CMP) the application doesnt have control over how the
> SQLs are issued and executed. All managed by Jboss. In situations like
> this what could be a viable alternative?
>
> Regards,
> Senthoor
>
> On 7/19/05, im i <linimi@gmail.com> wrote:
>
>> Hi,
>>
>> (Sorry my english.)
>>
>> I think, the problem is not in query. There is other statement what
>> corrupt the transaction before query, example insert or update. The
>> postgres 8. solve the problem with savepoint, you can create  
>> savepoint
>> before critical statement and when error occured you need rollback to
>> savepoint:
>>
>> http://www.postgresql.org/docs/8.0/interactive/sql-savepoint.html
>>
>> When you catch exception then the transaction is corrupt alredy.
>>
>> try {
>>     savepointName = this.getClass().getName() + "-" +
>> this.getClass().hashCode();
>>     savePoint = conn.setSavepoint(savepointName);
>>     stmt.execute();
>> } catch (SQLException sqle) {
>>     conn.rollback(savePoint);
>> }
>>
>> linimi
>>
>> On 7/19/05, Senthoorkumaran Punniamoorthy <senthoor@gmail.com> wrote:
>>
>>> We are using postgres as our DB for our application based on EJB.  
>>> I am
>>> using the pg74.216.jdbc3.jar driver.
>>>
>>> one of the EJB-QL in the finder method translates to a query in  
>>> JBoss as
>>>
>>> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM  
>>> rcp_user_device
>>> t0_o WHERE (t0_o.userId = ?)
>>>
>>> This query works on the postgres command line interface fine.
>>>
>>> SELECT t0_o.userId, t0_o.deviceId BEING_VAULT=# SELECT t0_o.userId,
>>> t0_o.deviceId FROM rcp_user_device t0_o WHERE (t0_o.userId =
>>> '94773059650')
>>> BEING_VAULT-# ;
>>>    userid    |    deviceid
>>> -------------+-----------------
>>>  94773059650 | 351532002206818
>>> (1 row)
>>>
>>> However JDBC driver is rasing an exception, and below is the  
>>> stack trace.
>>>
>>> 2005-07-19 12:14:54,506 DEBUG
>>> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean# 
>>> findAllByUser]
>>> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM  
>>> rcp_user_device
>>> t0_o WHERE (t0_o.userId = ?)
>>> 2005-07-19 12:14:54,509 ERROR
>>> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean# 
>>> findAllByUser]
>>> Find failed
>>> org.postgresql.util.PSQLException: ERROR: current transaction is
>>> aborted, commands ignored until end of transaction block
>>>
>>>         at org.postgresql.util.PSQLException.parseServerError 
>>> (PSQLException.java:139)
>>>         at org.postgresql.core.QueryExecutor.executeV3 
>>> (QueryExecutor.java:152)
>>>         at org.postgresql.core.QueryExecutor.execute 
>>> (QueryExecutor.java:100)
>>>         at org.postgresql.core.QueryExecutor.execute 
>>> (QueryExecutor.java:43)
>>>         at org.postgresql.jdbc1.AbstractJdbc1Statement.execute 
>>> (AbstractJdbc1Statement.java:517)
>>>         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute 
>>> (AbstractJdbc2Statement.java:50)
>>>         at  
>>> org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery 
>>> (AbstractJdbc1Statement.java:233)
>>>         at  
>>> org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuer 
>>> y(WrappedPreparedStatement.java:296)
>>>         at  
>>> org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute 
>>> (JDBCAbstractQueryCommand.java:228)
>>>         at  
>>> org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute 
>>> (JDBCAbstractQueryCommand.java:128)
>>>         at  
>>> org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute 
>>> (JDBCFindEntitiesCommand.java:40)
>>>         at  
>>> org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities 
>>> (JDBCStoreManager.java:598)
>>>         at  
>>> org.jboss.ejb.plugins.CMPPersistenceManager.findEntities 
>>> (CMPPersistenceManager.java:322)
>>>         at  
>>> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.fin 
>>> dEntities(CachedConnectionInterceptor.java:321)
>>>         at org.jboss.ejb.EntityContainer.findLocal 
>>> (EntityContainer.java:649)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>>> Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>>> (NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>>> (DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>         at org.jboss.invocation.Invocation.performCall 
>>> (Invocation.java:345)
>>>         at org.jboss.ejb.EntityContainer 
>>> $ContainerInterceptor.invokeHome(EntityContainer.java:1113)
>>>         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome 
>>> (AbstractInterceptor.java:90)
>>>         at  
>>> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome 
>>> (EntitySynchronizationInterceptor.java:192)
>>>         at  
>>> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.inv 
>>> okeHome(CachedConnectionInterceptor.java:212)
>>>         at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome 
>>> (AbstractInterceptor.java:90)
>>>         at  
>>> org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome 
>>> (EntityInstanceInterceptor.java:117)
>>>         at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome 
>>> (EntityLockInterceptor.java:61)
>>>         at  
>>> org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome 
>>> (EntityCreationInterceptor.java:28)
>>>         at  
>>> org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome 
>>> (CallValidationInterceptor.java:41)
>>>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext 
>>> (AbstractTxInterceptor.java:109)
>>>         at  
>>> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions 
>>> (TxInterceptorCMT.java:335)
>>>         at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome 
>>> (TxInterceptorCMT.java:146)
>>>         at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome 
>>> (SecurityInterceptor.java:116)
>>>         at org.jboss.ejb.plugins.LogInterceptor.invokeHome 
>>> (LogInterceptor.java:121)
>>>         at  
>>> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome 
>>> (ProxyFactoryFinderInterceptor.java:93)
>>>         at org.jboss.ejb.EntityContainer.internalInvokeHome 
>>> (EntityContainer.java:508)
>>>         at org.jboss.ejb.Container.invoke(Container.java:894)
>>>         at  
>>> org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome 
>>> (BaseLocalProxyFactory.java:342)
>>>         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke 
>>> (LocalHomeProxy.java:118)
>>>         at $Proxy279.findAllByUser(Unknown Source)
>>>         at  
>>> com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean. 
>>> deleteUserDevices(UnsubscriptionSessionBean.java:176)
>>>         at  
>>> com.purpleace.ripple.contacts.ejb.session.UnsubscriptionSessionBean. 
>>> unsubscribe(UnsubscriptionSessionBean.java:147)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>>> Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>>> (NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>>> (DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>         at org.jboss.invocation.Invocation.performCall 
>>> (Invocation.java:345)
>>>         at org.jboss.ejb.StatelessSessionContainer 
>>> $ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
>>>         at  
>>> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.inv 
>>> oke(CachedConnectionInterceptor.java:185)
>>>         at  
>>> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke 
>>> (StatelessSessionInstanceInterceptor.java:130)
>>>         at  
>>> org.jboss.webservice.server.ServiceEndpointInterceptor.invoke 
>>> (ServiceEndpointInterceptor.java:51)
>>>         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke 
>>> (CallValidationInterceptor.java:48)
>>>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext 
>>> (AbstractTxInterceptor.java:105)
>>>         at  
>>> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions 
>>> (TxInterceptorCMT.java:335)
>>>         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke 
>>> (TxInterceptorCMT.java:166)
>>>         at org.jboss.ejb.plugins.SecurityInterceptor.invoke 
>>> (SecurityInterceptor.java:139)
>>>         at org.jboss.ejb.plugins.LogInterceptor.invoke 
>>> (LogInterceptor.java:192)
>>>         at  
>>> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke 
>>> (ProxyFactoryFinderInterceptor.java:122)
>>>         at org.jboss.ejb.SessionContainer.internalInvoke 
>>> (SessionContainer.java:624)
>>>         at org.jboss.ejb.Container.invoke(Container.java:873)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>>> Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>>> (NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>>> (DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke 
>>> (ReflectedDispatcher.java:141)
>>>         at org.jboss.mx.server.Invocation.dispatch 
>>> (Invocation.java:80)
>>>         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
>>>         at org.jboss.mx.server.AbstractMBeanInvoker.invoke 
>>> (AbstractMBeanInvoker.java:249)
>>>         at org.jboss.mx.server.MBeanServerImpl.invoke 
>>> (MBeanServerImpl.java:644)
>>>         at org.jboss.invocation.local.LocalInvoker 
>>> $MBeanServerAction.invoke(LocalInvoker.java:155)
>>>         at org.jboss.invocation.local.LocalInvoker.invoke 
>>> (LocalInvoker.java:104)
>>>         at org.jboss.invocation.InvokerInterceptor.invokeLocal 
>>> (InvokerInterceptor.java:179)
>>>         at org.jboss.invocation.InvokerInterceptor.invoke 
>>> (InvokerInterceptor.java:165)
>>>         at org.jboss.proxy.TransactionInterceptor.invoke 
>>> (TransactionInterceptor.java:46)
>>>         at org.jboss.proxy.SecurityInterceptor.invoke 
>>> (SecurityInterceptor.java:55)
>>>         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke 
>>> (StatelessSessionInterceptor.java:97)
>>>         at org.jboss.proxy.ClientContainer.invoke 
>>> (ClientContainer.java:86)
>>>         at $Proxy379.unsubscribe(Unknown Source)
>>>         at  
>>> com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.r 
>>> emoveOldUser(MsisdnUpdaterSessionBean.java:248)
>>>         at  
>>> com.purpleace.ripple.contacts.ejb.session.MsisdnUpdaterSessionBean.u 
>>> pdateWhereUserIdEqualsMsisdn(MsisdnUpdaterSessionBean.java:231)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>>> Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>>> (NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>>> (DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>         at org.jboss.invocation.Invocation.performCall 
>>> (Invocation.java:345)
>>>         at org.jboss.ejb.StatelessSessionContainer 
>>> $ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
>>>         at  
>>> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.inv 
>>> oke(CachedConnectionInterceptor.java:185)
>>>         at  
>>> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke 
>>> (StatelessSessionInstanceInterceptor.java:130)
>>>         at  
>>> org.jboss.webservice.server.ServiceEndpointInterceptor.invoke 
>>> (ServiceEndpointInterceptor.java:51)
>>>         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke 
>>> (CallValidationInterceptor.java:48)
>>>         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext 
>>> (AbstractTxInterceptor.java:105)
>>>         at  
>>> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions 
>>> (TxInterceptorCMT.java:335)
>>>         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke 
>>> (TxInterceptorCMT.java:166)
>>>         at org.jboss.ejb.plugins.SecurityInterceptor.invoke 
>>> (SecurityInterceptor.java:139)
>>>         at org.jboss.ejb.plugins.LogInterceptor.invoke 
>>> (LogInterceptor.java:192)
>>>         at  
>>> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke 
>>> (ProxyFactoryFinderInterceptor.java:122)
>>>         at org.jboss.ejb.SessionContainer.internalInvoke 
>>> (SessionContainer.java:624)
>>>         at org.jboss.ejb.Container.invoke(Container.java:873)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>>> Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>>> (NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>>> (DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke 
>>> (ReflectedDispatcher.java:141)
>>>         at org.jboss.mx.server.Invocation.dispatch 
>>> (Invocation.java:80)
>>>         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
>>>         at org.jboss.mx.server.AbstractMBeanInvoker.invoke 
>>> (AbstractMBeanInvoker.java:249)
>>>         at org.jboss.mx.server.MBeanServerImpl.invoke 
>>> (MBeanServerImpl.java:644)
>>>         at org.jboss.invocation.local.LocalInvoker 
>>> $MBeanServerAction.invoke(LocalInvoker.java:155)
>>>         at org.jboss.invocation.local.LocalInvoker.invoke 
>>> (LocalInvoker.java:104)
>>>         at org.jboss.invocation.InvokerInterceptor.invokeLocal 
>>> (InvokerInterceptor.java:179)
>>>         at org.jboss.invocation.InvokerInterceptor.invoke 
>>> (InvokerInterceptor.java:165)
>>>         at org.jboss.proxy.TransactionInterceptor.invoke 
>>> (TransactionInterceptor.java:46)
>>>         at org.jboss.proxy.SecurityInterceptor.invoke 
>>> (SecurityInterceptor.java:55)
>>>         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke 
>>> (StatelessSessionInterceptor.java:97)
>>>         at org.jboss.proxy.ClientContainer.invoke 
>>> (ClientContainer.java:86)
>>>         at $Proxy361.updateWhereUserIdEqualsMsisdn(Unknown Source)
>>>         at  
>>> com.purpleace.ripple.contacts.serviceinterface.facade.ChangeMsisdnFa 
>>> cade.changeMsisdn(ChangeMsisdnFacade.java:44)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.cont 
>>> roller(ChangeMsisdnServelet.java:166)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.newH 
>>> andleRequest(ChangeMsisdnServelet.java:78)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.ChangeMsisdnServelet.doPo 
>>> st(ChangeMsisdnServelet.java:61)
>>>         at javax.servlet.http.HttpServlet.service 
>>> (HttpServlet.java:717)
>>>         at javax.servlet.http.HttpServlet.service 
>>> (HttpServlet.java:810)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
>>> (ApplicationFilterChain.java:252)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter 
>>> (ApplicationFilterChain.java:173)
>>>         at org.apache.catalina.core.ApplicationDispatcher.invoke 
>>> (ApplicationDispatcher.java:672)
>>>         at  
>>> org.apache.catalina.core.ApplicationDispatcher.processRequest 
>>> (ApplicationDispatcher.java:463)
>>>         at  
>>> org.apache.catalina.core.ApplicationDispatcher.doForward 
>>> (ApplicationDispatcher.java:398)
>>>         at org.apache.catalina.core.ApplicationDispatcher.forward 
>>> (ApplicationDispatcher.java:301)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.RippleServlet.controller( 
>>> RippleServlet.java:271)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.RippleServlet.parseString 
>>> (RippleServlet.java:425)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.RippleServlet.handleReque 
>>> st(RippleServlet.java:124)
>>>         at  
>>> com.purpleace.ripple.contacts.web.servlets.RippleServlet.doPost 
>>> (RippleServlet.java:70)
>>>         at javax.servlet.http.HttpServlet.service 
>>> (HttpServlet.java:717)
>>>         at javax.servlet.http.HttpServlet.service 
>>> (HttpServlet.java:810)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
>>> (ApplicationFilterChain.java:252)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter 
>>> (ApplicationFilterChain.java:173)
>>>         at  
>>> com.purpleace.ripple.contacts.web.filters.GlobalFilter.doFilter 
>>> (GlobalFilter.java:37)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
>>> (ApplicationFilterChain.java:202)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter 
>>> (ApplicationFilterChain.java:173)
>>>         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter 
>>> (ReplyHeaderFilter.java:81)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
>>> (ApplicationFilterChain.java:202)
>>>         at  
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter 
>>> (ApplicationFilterChain.java:173)
>>>         at org.apache.catalina.core.StandardWrapperValve.invoke 
>>> (StandardWrapperValve.java:213)
>>>         at org.apache.catalina.core.StandardContextValve.invoke 
>>> (StandardContextValve.java:178)
>>>         at  
>>> org.jboss.web.tomcat.security.CustomPrincipalValve.invoke 
>>> (CustomPrincipalValve.java:39)
>>>         at  
>>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke 
>>> (SecurityAssociationValve.java:153)
>>>         at org.jboss.web.tomcat.security.JaccContextValve.invoke 
>>> (JaccContextValve.java:59)
>>>         at org.apache.catalina.core.StandardHostValve.invoke 
>>> (StandardHostValve.java:126)
>>>         at org.apache.catalina.valves.ErrorReportValve.invoke 
>>> (ErrorReportValve.java:105)
>>>         at org.apache.catalina.core.StandardEngineValve.invoke 
>>> (StandardEngineValve.java:107)
>>>         at org.apache.catalina.connector.CoyoteAdapter.service 
>>> (CoyoteAdapter.java:148)
>>>         at org.apache.coyote.http11.Http11Processor.process 
>>> (Http11Processor.java:856)
>>>         at org.apache.coyote.http11.Http11Protocol 
>>> $Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
>>>         at  
>>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket 
>>> (PoolTcpEndpoint.java:527)
>>>         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run 
>>> (MasterSlaveWorkerThread.java:112)
>>>         at java.lang.Thread.run(Thread.java:534)
>>>
>>> Can you help me identify this issue?
>>>
>>> Regards,
>>> Senthoor
>>>
>>> ---------------------------(end of  
>>> broadcast)---------------------------
>>> TIP 5: don't forget to increase your free space map settings
>>>
>>>
>>
>>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>




^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: current transaction
  2005-07-19 08:56 org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
@ 2005-07-19 12:16 ` Oliver Jowett <oliver@opencloud.com>
  1 sibling, 0 replies; 26+ messages in thread

From: Oliver Jowett @ 2005-07-19 12:16 UTC (permalink / raw)
  To: Senthoorkumaran Punniamoorthy <senthoor@gmail.com>; +Cc: pgsql-jdbc

Senthoorkumaran Punniamoorthy wrote:

> 2005-07-19 12:14:54,506 DEBUG
> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM rcp_user_device
> t0_o WHERE (t0_o.userId = ?)
> 2005-07-19 12:14:54,509 ERROR
> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#findAllByUser]
> Find failed
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block

This means that a *previous* query in the same transaction has failed. 
Check for errors caused by an earlier query.

-O



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: current
@ 2005-07-20 15:31 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 26+ messages in thread

From: Kevin Grittner @ 2005-07-20 15:31 UTC (permalink / raw)
  To: pg@fastcrypt.com; senthoor@gmail.com; +Cc: pgsql-jdbc

It isn't necessarily that simple.  Since the previous error didn't
generate a stack trace, it was presumably caught and handled as an
"expected" issue.  The problem may be that other database products
tolerate execution of further statements after an exception, and the
framework is assuming such behavior.
 
I've seen cases where the transaction is automatically rolled back by
the database product in response to some problems, allowing statements
to proceed under a new database transaction.  I've also seen cases where
an exception is tolerated within a database transaction without ending
the transaction or prohibiting further queries (e.g. an insert fails,
and you can try an update, all in the same transaction).
 
It may be that the framework is not handling the PostgreSQL approach of
"aborting" a database transaction without rolling it back.  This may
require a fix in JBoss.
 
-Kevin
 
 
>>> Dave Cramer <pg@fastcrypt.com> 07/19/05 8:59 PM >>>
Somewhere before the query that threw the exception an error occured.

Fix that and this exception will go away.

. . .

>>> 2005-07-19 12:14:54,506 DEBUG
>>> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#

>>> findAllByUser]
>>> Executing SQL: SELECT t0_o.userId, t0_o.deviceId FROM  
>>> rcp_user_device
>>> t0_o WHERE (t0_o.userId = ?)
>>> 2005-07-19 12:14:54,509 ERROR
>>> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.UserDeviceEntityBean#

>>> findAllByUser]
>>> Find failed
>>> org.postgresql.util.PSQLException: ERROR: current transaction is
>>> aborted, commands ignored until end of transaction block




^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
@ 2009-06-17 13:35 Ashish Jain <ashjain2@gmail.com>
  2009-06-17 14:56 ` Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Richard Broersma <richard.broersma@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: Ashish Jain @ 2009-06-17 13:35 UTC (permalink / raw)
  To: pgsql-jdbc

Hi All,

I am using postgresql 8.3.5 and I hit the following error during one of my
fetch queries. I googled and found that V8.3 onwards Non-character data
types are no longer automatically cast to TEXT.
I also found that a custom cast can be written.
Can any one help me to write a cast statement which automatically cast
integer to character??

Here is the error which I hit

org.postgresql.util.PSQLException: ERROR: operator does not exist: character
varying = integer
    at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
    at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1316)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:191)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:255)
    at sun.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:599)
    at
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:471)
    at $Proxy45.executeQuery(Unknown Source)
    at
org.tranql.connector.jdbc.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:49)
    at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:264)
    at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:842)
    at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:262)
    at
org.apache.openjpa.jdbc.sql.PostgresDictionary$PostgresPreparedStatement.executeQuery(PostgresDictionary.java:365)
    at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:262)
    at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1372)
    at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:252)
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:372)
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:330)
    at
org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:407)
    at
org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:218)
    at
org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:208)
    at
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
    at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
    at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1223)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:842)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:773)
    at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
    at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:237)
    at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
    at
com.tnhsp.sbean.biomedicalwaste.WasteDetailsSBean.findForModifyWard(WasteDetailsSBean.java:155)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:599)
    at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
    at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
    at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
    at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:210)
    at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
    at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
    at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
    at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
    at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:245)
    at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
    at $Proxy21.findForModifyWard(Unknown Source)
    at
com.tnhsp.mbeans.biomedicalwaste.wasteDetailsMBean.actionGo(wasteDetailsMBean.java:242)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:599)
    at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
    at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    at
org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
    at
javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:75)
    at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:54)
    at javax.faces.component.UICommand.broadcast(UICommand.java:121)
    at
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
    at
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
    at
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
    at
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
    at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
    at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
    at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at SessionFilter.doFilter(SessionFilter.java:43)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
    at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
    at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:735)


Thanks
Ashish

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
  2009-06-17 13:35 org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Ashish Jain <ashjain2@gmail.com>
@ 2009-06-17 14:56 ` Richard Broersma <richard.broersma@gmail.com>
  2009-06-17 19:10   ` Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Ashish Jain <ashjain2@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: Richard Broersma @ 2009-06-17 14:56 UTC (permalink / raw)
  To: Ashish Jain <ashjain2@gmail.com>; +Cc: pgsql-jdbc

On Wed, Jun 17, 2009 at 6:35 AM, Ashish Jain<ashjain2@gmail.com> wrote:

> Can any one help me to write a cast statement which automatically cast
> integer to character??

The SQL standard way would be:  CAST( your_int_column AS TEXT )
or the Postgresql way:  your_int_column::TEXT


-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
  2009-06-17 13:35 org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Ashish Jain <ashjain2@gmail.com>
  2009-06-17 14:56 ` Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Richard Broersma <richard.broersma@gmail.com>
@ 2009-06-17 19:10   ` Ashish Jain <ashjain2@gmail.com>
  0 siblings, 0 replies; 26+ messages in thread

From: Ashish Jain @ 2009-06-17 19:10 UTC (permalink / raw)
  To: Richard Broersma <richard.broersma@gmail.com>; +Cc: pgsql-jdbc

Hi Richard,

I have created a function and a cast in the following way. It helps me to
subside the error but I still do not get the desired result. So I am not
sure if this only helps to subside the error message.

create function integer2character(in integer) returns character as 'select

$1::character' language sql immutable returns null on null input;





create cast (integer AS character) with function integer2character (in
integer) AS

implicit;


Thanks
Ashish


On Wed, Jun 17, 2009 at 8:26 PM, Richard Broersma <
richard.broersma@gmail.com> wrote:

> On Wed, Jun 17, 2009 at 6:35 AM, Ashish Jain<ashjain2@gmail.com> wrote:
>
> > Can any one help me to write a cast statement which automatically cast
> > integer to character??
>
> The SQL standard way would be:  CAST( your_int_column AS TEXT )
> or the Postgresql way:  your_int_column::TEXT
>
>
> --
> Regards,
> Richard Broersma Jr.
>
> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> http://pugs.postgresql.org/lapug
>

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42
@ 2010-03-27 08:19 Sriram P <sriramkumar1985@gmail.com>
  2010-03-28 00:53 ` Re: org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42 Craig Ringer <craig@postnewspapers.com.au>
  0 siblings, 1 reply; 26+ messages in thread

From: Sriram P @ 2010-03-27 08:19 UTC (permalink / raw)
  To: pgsql-jdbc


While im using postgresql with jdbc i m getting following error

org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist
Position: 42 

could you plz help me out how to fix this issue
-- 
View this message in context: http://old.nabble.com/org.postgresql.util.PSQLException%3A-ERROR%3A-relation-%22dual%22-does-not-exi...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42
  2010-03-27 08:19 org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42 Sriram P <sriramkumar1985@gmail.com>
@ 2010-03-28 00:53 ` Craig Ringer <craig@postnewspapers.com.au>
  0 siblings, 0 replies; 26+ messages in thread

From: Craig Ringer @ 2010-03-28 00:53 UTC (permalink / raw)
  To: Sriram P <sriramkumar1985@gmail.com>; +Cc: pgsql-jdbc

On 27/03/2010 4:19 PM, Sriram P wrote:
>
> While im using postgresql with jdbc i m getting following error
>
> org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist
> Position: 42

You're using code written for Oracle. You need to fix your SQL so it'll 
run on PostgreSQL.

If you want help with that, you'll have to post the SQL and some other 
basic information. See:
   http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

--
Craig Ringer



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
@ 2016-05-06 19:14 peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: peter.penzov @ 2016-05-06 19:14 UTC (permalink / raw)
  To: pgsql-jdbc

I want to implement file upload into PostgreSQL using JSF page. I tried this
code:

public void upload() throws SQLException, GSSException
{
    if (file != null)
    {
        try
        {
            InputStream inputStream = file.getInputStream();
            Connection conn = ds.getConnection();
            PreparedStatement ps = null;
            boolean committed = false;
            try
            {
                conn.setAutoCommit(false);

                ps = conn.prepareStatement("INSERT INTO PROCEDURE_FILES (ID,
PROCEDURE_ID, FILE_NAME, FILE) "
                    + " VALUES (?, ?, ?, ?)");
                ps.setInt(1, obj.number);
                ps.setInt(2, obj.number);
                ps.setString(3, file.getSubmittedFileName());

                ps.setBinaryStream(4, inputStream, inputStream.available());

                ps.executeUpdate();
                ps.close();

                conn.commit();
                committed = true;
            }
            catch (SQLException e)
            {
                e.printStackTrace();
            }

            finally
            {
                if (!committed)
                {
                    conn.rollback();
                }

                if (ps != null)
                {
                    ps.close();
                }
                conn.close();
            }

            FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Upload successfully ended!"));
        }
        catch (IOException e)
        {
            FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Upload failed!"));
        }
    }
}

But I get error error:

org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but
expression is of type bytea
  Hint: You will need to rewrite or cast the expression.
  Position: 86

What is the proper way to cast the Object?



--
View this message in context: http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
@ 2016-05-06 21:07 ` peter.penzov <peter.penzov@gmail.com>
  2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 26+ messages in thread

From: peter.penzov @ 2016-05-06 21:07 UTC (permalink / raw)
  To: pgsql-jdbc

possible reason of the problem:

javax.servlet.http.Part
a Part does not represent an entire file... is just a part... 

full code
http://pastebin.com/guQcSiwG



--
View this message in context: http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
@ 2016-05-06 22:58   ` Dave Cramer <pg@fastcrypt.com>
  2016-05-07 17:04     ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: Dave Cramer @ 2016-05-06 22:58 UTC (permalink / raw)
  To: peter.penzov <peter.penzov@gmail.com>; +Cc: pgsql-jdbc

Peter,

Perhaps this
https://jdbc.postgresql.org/documentation/head/binary-data.html#binary-data-example
can be of assistance

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 6 May 2016 at 17:07, peter.penzov <peter.penzov@gmail.com> wrote:

> possible reason of the problem:
>
> javax.servlet.http.Part
> a Part does not represent an entire file... is just a part...
>
> full code
> http://pastebin.com/guQcSiwG
>
>
>
> --
> View this message in context:
> http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
@ 2016-05-07 17:04     ` peter.penzov <peter.penzov@gmail.com>
  2016-05-07 17:39       ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 26+ messages in thread

From: peter.penzov @ 2016-05-07 17:04 UTC (permalink / raw)
  To: pgsql-jdbc

I managed to create this:

public void upload() throws SQLException, GSSException
{
    if (file != null)
    {
        try
        {
            InputStream inputStream = file.getInputStream();
            Connection conn = ds.getConnection();
            PreparedStatement ps = null;
            boolean committed = false;
            try
            {
                conn.setAutoCommit(false);

                ps = conn.prepareStatement("INSERT INTO PROCEDURE_FILES (ID,
PROCEDURE_ID, FILE_NAME, FILE) "
                    + " VALUES (?, ?, ?, ?)");
                ps.setInt(1, obj.number);
                ps.setInt(2, obj.number);
                ps.setString(3, file.getSubmittedFileName());

                ps.setBlob(4, inputStream, inputStream.available());

                ps.executeUpdate();
                ps.close();

                conn.commit();
                committed = true;
            }
            catch (SQLException e)
            {
                e.printStackTrace();
            }

            finally
            {
                if (!committed)
                {
                    conn.rollback();
                }

                if (ps != null)
                {
                    ps.close();
                }
                conn.close();
            }
        }
        catch (IOException e)
        {
            FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Upload failed!"));
        }
    }
}

public void initFileDBData() throws SQLException, IOException
    {
        Connection conn = ds.getConnection();
        PreparedStatement ps = null;

        try
        {
            conn.setAutoCommit(false);

            ps = conn.prepareStatement("SELECT * FROM PROCEDURE_FILES WHERE
ID = ?");

            ps.setInt(1, id);
            ResultSet rs = ps.executeQuery();
            while (rs.next())
            {
                String file_name = rs.getString("FILE_NAME");
                Blob oid = rs.getBlob("FILE");
                InputStream binaryStreasm = oid.getBinaryStream();

                FacesContext fc = FacesContext.getCurrentInstance();
                ExternalContext ec = fc.getExternalContext();

                ec.responseReset();
                ec.setResponseContentLength(binaryStreasm.available());
                ec.setResponseHeader("Content-Disposition", "attachment;
filename=\"" + file_name + "\"");

                byte[] buf;

                buf = new byte[binaryStreasm.available()];
                int offset = 0;
                int numRead = 0;
                while ((offset < buf.length) && ((numRead =
binaryStreasm.read(buf, offset, buf.length - offset)) >= 0))
                {
                    offset += numRead;
                }

                HttpServletResponse response
                    = (HttpServletResponse)
FacesContext.getCurrentInstance()
                    .getExternalContext().getResponse();

                response.setContentType("application/octet-stream");
                response.setHeader("Content-Disposition",
"attachment;filename=" + file_name);
                response.getOutputStream().write(buf);
                response.getOutputStream().flush();
                response.getOutputStream().close();
                FacesContext.getCurrentInstance().responseComplete();
            }
        }
        finally
        {
            if (ps != null)
            {
                ps.close();
            }
            conn.close();
        }
    }


But when I download the file it's always 0 bytes in size. Do you have any
idea how I can fix this?



--
View this message in context: http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  2016-05-07 17:04     ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
@ 2016-05-07 17:39       ` Dave Cramer <pg@fastcrypt.com>
  2016-05-07 18:46         ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: Dave Cramer @ 2016-05-07 17:39 UTC (permalink / raw)
  To: peter.penzov <peter.penzov@gmail.com>; +Cc: pgsql-jdbc

This really isn't a  JDBC question...

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 7 May 2016 at 13:04, peter.penzov <peter.penzov@gmail.com> wrote:

> I managed to create this:
>
> public void upload() throws SQLException, GSSException
> {
>     if (file != null)
>     {
>         try
>         {
>             InputStream inputStream = file.getInputStream();
>             Connection conn = ds.getConnection();
>             PreparedStatement ps = null;
>             boolean committed = false;
>             try
>             {
>                 conn.setAutoCommit(false);
>
>                 ps = conn.prepareStatement("INSERT INTO PROCEDURE_FILES
> (ID,
> PROCEDURE_ID, FILE_NAME, FILE) "
>                     + " VALUES (?, ?, ?, ?)");
>                 ps.setInt(1, obj.number);
>                 ps.setInt(2, obj.number);
>                 ps.setString(3, file.getSubmittedFileName());
>
>                 ps.setBlob(4, inputStream, inputStream.available());
>
>                 ps.executeUpdate();
>                 ps.close();
>
>                 conn.commit();
>                 committed = true;
>             }
>             catch (SQLException e)
>             {
>                 e.printStackTrace();
>             }
>
>             finally
>             {
>                 if (!committed)
>                 {
>                     conn.rollback();
>                 }
>
>                 if (ps != null)
>                 {
>                     ps.close();
>                 }
>                 conn.close();
>             }
>         }
>         catch (IOException e)
>         {
>             FacesContext.getCurrentInstance().addMessage(null, new
> FacesMessage("Upload failed!"));
>         }
>     }
> }
>
> public void initFileDBData() throws SQLException, IOException
>     {
>         Connection conn = ds.getConnection();
>         PreparedStatement ps = null;
>
>         try
>         {
>             conn.setAutoCommit(false);
>
>             ps = conn.prepareStatement("SELECT * FROM PROCEDURE_FILES WHERE
> ID = ?");
>
>             ps.setInt(1, id);
>             ResultSet rs = ps.executeQuery();
>             while (rs.next())
>             {
>                 String file_name = rs.getString("FILE_NAME");
>                 Blob oid = rs.getBlob("FILE");
>                 InputStream binaryStreasm = oid.getBinaryStream();
>
>                 FacesContext fc = FacesContext.getCurrentInstance();
>                 ExternalContext ec = fc.getExternalContext();
>
>                 ec.responseReset();
>                 ec.setResponseContentLength(binaryStreasm.available());
>                 ec.setResponseHeader("Content-Disposition", "attachment;
> filename=\"" + file_name + "\"");
>
>                 byte[] buf;
>
>                 buf = new byte[binaryStreasm.available()];
>                 int offset = 0;
>                 int numRead = 0;
>                 while ((offset < buf.length) && ((numRead =
> binaryStreasm.read(buf, offset, buf.length - offset)) >= 0))
>                 {
>                     offset += numRead;
>                 }
>
>                 HttpServletResponse response
>                     = (HttpServletResponse)
> FacesContext.getCurrentInstance()
>                     .getExternalContext().getResponse();
>
>                 response.setContentType("application/octet-stream");
>                 response.setHeader("Content-Disposition",
> "attachment;filename=" + file_name);
>                 response.getOutputStream().write(buf);
>                 response.getOutputStream().flush();
>                 response.getOutputStream().close();
>                 FacesContext.getCurrentInstance().responseComplete();
>             }
>         }
>         finally
>         {
>             if (ps != null)
>             {
>                 ps.close();
>             }
>             conn.close();
>         }
>     }
>
>
> But when I download the file it's always 0 bytes in size. Do you have any
> idea how I can fix this?
>
>
>
> --
> View this message in context:
> http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  2016-05-07 17:04     ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-07 17:39       ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
@ 2016-05-07 18:46         ` peter.penzov <peter.penzov@gmail.com>
  2016-05-07 19:10           ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 26+ messages in thread

From: peter.penzov @ 2016-05-07 18:46 UTC (permalink / raw)
  To: pgsql-jdbc

Did you managed to successfully implement similar code? Can you give some
advice how to fix it?



--
View this message in context: http://postgresql.nabble.com/org-postgresql-util-PSQLException-ERROR-column-file-is-of-type-oid-but-...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea
  2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  2016-05-07 17:04     ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
  2016-05-07 17:39       ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
  2016-05-07 18:46         ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
@ 2016-05-07 19:10           ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 26+ messages in thread

From: David G. Johnston @ 2016-05-07 19:10 UTC (permalink / raw)
  To: peter.penzov <peter.penzov@gmail.com>; +Cc: pgsql-jdbc

On Saturday, May 7, 2016, peter.penzov <peter.penzov@gmail.com> wrote:

> Did you managed to successfully implement similar code? Can you give some
> advice how to fix it?
>
>
This is not self-contained so advice is hard to give.

I would suggest removing the extraneous stuff, like http, and getting the
basic SQL to work reliably in a pure jdbc/Java main (or junit...) program
first.

The oid error implies large object usage which is not jdbc compatible.
Either make the column bytea or learn how to use the PostgreSQL driver's
large object API.  I'm guessing a bit here because, as I said, your example
is lacking detail.  I've had no issues with bytea though I haven't made use
of streams.

David J.

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* org.postgresql.util.PSQLException: ERROR: value out of range: underflow
@ 2022-02-06 09:07 Thomas Markus <t.markus@proventis.net>
  2022-02-06 16:45 ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 26+ messages in thread

From: Thomas Markus @ 2022-02-06 09:07 UTC (permalink / raw)
  To: pgsql-jdbc@lists.postgresql.org

Hello

a customer got the exception "org.postgresql.util.PSQLException: ERROR: 
value out of range: underflow" without any stacktrace etc.
System is Linux with PG 12.2

Once I got a similar error in Oracle so I checked double values for edge 
cases (see below) but without success. This message is also not part of 
pgjdbc.

Has anyone any idea where this message may originate from? The only used 
datatypes for numbers are bigint, integer and double precision.

Thanks
Thomas

Test:

try (Statement s = c.createStatement()) {
     s.executeUpdate("create table x (x double precision)");
}
try (PreparedStatement p = c.prepareStatement("insert into x (x) values 
(?)")) {

     p.setDouble(1, Double.MIN_VALUE);
     p.executeUpdate();

     p.setDouble(1, -Double.MIN_VALUE);
     p.executeUpdate();

     p.setDouble(1, Double.MIN_NORMAL);
     p.executeUpdate();

     p.setDouble(1, -Double.MIN_NORMAL);
     p.executeUpdate();

     p.setDouble(1, Double.MAX_VALUE);
     p.executeUpdate();

     p.setDouble(1, -Double.MAX_VALUE);
     p.executeUpdate();

     p.setDouble(1, Double.NEGATIVE_INFINITY);
     p.executeUpdate();

     p.setDouble(1, Double.POSITIVE_INFINITY);
     p.executeUpdate();

     p.setDouble(1, Double.NaN);
     p.executeUpdate();

}








^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
  2022-02-06 09:07 org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
@ 2022-02-06 16:45 ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-02-06 18:25   ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Dave Cramer <davecramer@postgres.rocks>
  2022-02-07 05:39   ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
  0 siblings, 2 replies; 26+ messages in thread

From: Tom Lane @ 2022-02-06 16:45 UTC (permalink / raw)
  To: Thomas Markus <t.markus@proventis.net>; +Cc: pgsql-jdbc@lists.postgresql.org

Thomas Markus <t.markus@proventis.net> writes:
> a customer got the exception "org.postgresql.util.PSQLException: ERROR: 
> value out of range: underflow" without any stacktrace etc.

I'd venture that the cause is some server-side double precision
arithmetic that underflowed.  It's not that hard to hit, eg

postgres=# select 1e-200::float8 * 1e-200::float8;
ERROR:  value out of range: underflow

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
  2022-02-06 09:07 org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
  2022-02-06 16:45 ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-02-06 18:25   ` Dave Cramer <davecramer@postgres.rocks>
  1 sibling, 0 replies; 26+ messages in thread

From: Dave Cramer @ 2022-02-06 18:25 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Markus <t.markus@proventis.net>; pgsql-jdbc@lists.postgresql.org

On Sun, 6 Feb 2022 at 11:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Thomas Markus <t.markus@proventis.net> writes:
> > a customer got the exception "org.postgresql.util.PSQLException: ERROR:
> > value out of range: underflow" without any stacktrace etc.
>
> I'd venture that the cause is some server-side double precision
> arithmetic that underflowed.  It's not that hard to hit, eg
>
> postgres=# select 1e-200::float8 * 1e-200::float8;
> ERROR:  value out of range: underflow
>
>                         regards, tom lane
>
I mistakenly responded privately and OP responded to that.

Turns out a column was added with the wrong type.

Dave

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
  2022-02-06 09:07 org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
  2022-02-06 16:45 ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-02-07 05:39   ` Thomas Markus <t.markus@proventis.net>
  1 sibling, 0 replies; 26+ messages in thread

From: Thomas Markus @ 2022-02-07 05:39 UTC (permalink / raw)
  To: pgsql-jdbc@lists.postgresql.org


Am 06.02.22 um 17:45 schrieb Tom Lane:
> Thomas Markus <t.markus@proventis.net> writes:
>> a customer got the exception "org.postgresql.util.PSQLException: ERROR:
>> value out of range: underflow" without any stacktrace etc.
> I'd venture that the cause is some server-side double precision
> arithmetic that underflowed.  It's not that hard to hit, eg
>
> postgres=# select 1e-200::float8 * 1e-200::float8;
> ERROR:  value out of range: underflow
>
> 			regards, tom lane
>
>
Dave answered private here:

A double in java cant hold such big numbers. In fits fine in float8
Here one of our developers added a float4 column manually instead of 
float8. With float4 its easy to force that error.

regards
Thomas






^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData
@ 2023-02-10 21:26 Siddharth Jain <siddhsql@gmail.com>
  2023-02-10 21:33 ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Prasanth <dbadmin@pangburngroup.com>
  2023-02-10 21:34 ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 2 replies; 26+ messages in thread

From: Siddharth Jain @ 2023-02-10 21:26 UTC (permalink / raw)
  To: pgsql-jdbc@lists.postgresql.org

Hello,

We are using Postgres 14.4 server and 42.5.2 of org.postgresql:postgresql
to connect to it from Java.
We get following exception:
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or
near "("
  Position: 13
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:316)
at
org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData(PgPreparedStatement.java:1705)
at
org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
at
org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
at cdao.dpde.InsertHelper.setParameters(InsertHelper.java:53)
where the code in the last line is:
ParameterMetaData parameterMetaData = query.getParameterMetaData();

How can we fix this?

S.

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData
  2023-02-10 21:26 org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
@ 2023-02-10 21:33 ` Prasanth <dbadmin@pangburngroup.com>
  2023-02-10 21:56   ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
  1 sibling, 1 reply; 26+ messages in thread

From: Prasanth @ 2023-02-10 21:33 UTC (permalink / raw)
  To: pgsql-jdbc@lists.postgresql.org

Did you check the query being used? Most likely that is where the issue would be.

On 2/10/23 3:26 PM, Siddharth Jain wrote:
> Hello,
>
> We are using Postgres 14.4 server and 42.5.2 of org.postgresql:postgresql to connect to it from Java.
> We get following exception:
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "("
>   Position: 13
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:316)
> at org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData(PgPreparedStatement.java:1705)
> at org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
> at org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
> at cdao.dpde.InsertHelper.setParameters(InsertHelper.java:53)
> where the code in the last line is:
> ParameterMetaData parameterMetaData = query.getParameterMetaData();
>
> How can we fix this?
>
> S.

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData
  2023-02-10 21:26 org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
  2023-02-10 21:33 ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Prasanth <dbadmin@pangburngroup.com>
@ 2023-02-10 21:56   ` Siddharth Jain <siddhsql@gmail.com>
  0 siblings, 0 replies; 26+ messages in thread

From: Siddharth Jain @ 2023-02-10 21:56 UTC (permalink / raw)
  To: dbadmin@pangburngroup.com; +Cc: pgsql-jdbc@lists.postgresql.org

Thanks. query was the problem indeed. My mistake.

On Fri, Feb 10, 2023 at 1:33 PM Prasanth <dbadmin@pangburngroup.com> wrote:

> Did you check the query being used? Most likely that is where the issue
> would be.
>
> On 2/10/23 3:26 PM, Siddharth Jain wrote:
>
> Hello,
>
> We are using Postgres 14.4 server and 42.5.2 of org.postgresql:postgresql
> to connect to it from Java.
> We get following exception:
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or
> near "("
>   Position: 13
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:316)
> at
> org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData(PgPreparedStatement.java:1705)
> at
> org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
> at
> org.apache.commons.dbcp2.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:162)
> at cdao.dpde.InsertHelper.setParameters(InsertHelper.java:53)
> where the code in the last line is:
> ParameterMetaData parameterMetaData = query.getParameterMetaData();
>
> How can we fix this?
>
> S.
>
>
>

^ permalink  raw  reply  [nested|flat] 26+ messages in thread

* Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData
  2023-02-10 21:26 org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
@ 2023-02-10 21:34 ` David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 0 replies; 26+ messages in thread

From: David G. Johnston @ 2023-02-10 21:34 UTC (permalink / raw)
  To: Siddharth Jain <siddhsql@gmail.com>; +Cc: pgsql-jdbc@lists.postgresql.org

On Fri, Feb 10, 2023 at 2:26 PM Siddharth Jain <siddhsql@gmail.com> wrote:

>
> We are using Postgres 14.4 server and 42.5.2 of org.postgresql:postgresql
> to connect to it from Java.
> We get following exception:
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or
> near "("
>   Position: 13
>


> where the code in the last line is:
> ParameterMetaData parameterMetaData = query.getParameterMetaData();
>
> How can we fix this?
>
>
If the broken query is one generated by the driver you probably cannot, you
would need to file a bug report.  I strongly doubt your lack of
current-ness on the PostgreSQL is going to be an influence here but maybe...

In any case you are going to need something much more descriptive, and
ideally executable than this, if you actually want to debug and then file a
bug report (or fix your code if that is where the problem originates).

David J.

^ permalink  raw  reply  [nested|flat] 26+ messages in thread


end of thread, other threads:[~2023-02-10 21:56 UTC | newest]

Thread overview: 26+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-19 08:56 org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
2005-07-19 10:47 ` im i <linimi@gmail.com>
2005-07-20 01:24   ` Senthoorkumaran Punniamoorthy <senthoor@gmail.com>
2005-07-20 01:59     ` Dave Cramer <pg@fastcrypt.com>
2005-07-19 12:16 ` Re: org.postgresql.util.PSQLException: ERROR: current transaction Oliver Jowett <oliver@opencloud.com>
2005-07-20 15:31 Re: org.postgresql.util.PSQLException: ERROR: current Kevin Grittner <Kevin.Grittner@wicourts.gov>
2009-06-17 13:35 org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Ashish Jain <ashjain2@gmail.com>
2009-06-17 14:56 ` Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Richard Broersma <richard.broersma@gmail.com>
2009-06-17 19:10   ` Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer Ashish Jain <ashjain2@gmail.com>
2010-03-27 08:19 org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42 Sriram P <sriramkumar1985@gmail.com>
2010-03-28 00:53 ` Re: org.postgresql.util.PSQLException: ERROR: relation "dual" does not exist Position: 42 Craig Ringer <craig@postnewspapers.com.au>
2016-05-06 19:14 org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
2016-05-06 21:07 ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
2016-05-06 22:58   ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
2016-05-07 17:04     ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
2016-05-07 17:39       ` Re: Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea Dave Cramer <pg@fastcrypt.com>
2016-05-07 18:46         ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea peter.penzov <peter.penzov@gmail.com>
2016-05-07 19:10           ` Re: org.postgresql.util.PSQLException: ERROR: column "file" is of type oid but expression is of type bytea David G. Johnston <david.g.johnston@gmail.com>
2022-02-06 09:07 org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
2022-02-06 16:45 ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Tom Lane <tgl@sss.pgh.pa.us>
2022-02-06 18:25   ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Dave Cramer <davecramer@postgres.rocks>
2022-02-07 05:39   ` Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow Thomas Markus <t.markus@proventis.net>
2023-02-10 21:26 org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
2023-02-10 21:33 ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Prasanth <dbadmin@pangburngroup.com>
2023-02-10 21:56   ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData Siddharth Jain <siddhsql@gmail.com>
2023-02-10 21:34 ` Re: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" when calling org.postgresql.jdbc.PgPreparedStatement.getParameterMetaData David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox