Getting error during insertion of the data in postgresql 9.3

currently i am using PostgreSQL Professional Advanced Server (PPAS) 9.3 (a modified version of PostgreSQL 9.3).

I'm trying to insert a row in to postgresql database and getting following error:

error log:
javax.ejb.EJBTransactionRolledbackException: [2] An exception has occurred: ERROR: current transaction is aborted, commands ignored until end of transaction
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(
        at org.jboss.aspects.tx.TxInterceptor$Supports.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at org.apache.catalina.core.StandardWrapperValve.invoke(
        at org.apache.catalina.core.StandardContextValve.invoke(
        at org.apache.catalina.core.StandardHostValve.invoke(
        at org.apache.catalina.valves.ErrorReportValve.invoke(
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
        at org.apache.catalina.core.StandardEngineValve.invoke(
        at org.apache.catalina.connector.CoyoteAdapter.service(
        at org.apache.coyote.http11.Http11Processor.process(
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: com.code.Exception: [2] An exception has occurred: ERROR: current transaction is aborted, commands ignored until end of transaction bl
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(
        ... 75 more
Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(
        at org.postgresql.core.v3.QueryExecutorImpl.execute(
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(

        ... 95 more

I tried to create begin transaction object first and then rollback if exception comes it didn't help me.

even I am using single insert statement. As i know that if previous statement fails to execute then this error comes but in my case i have only single statement only but also i am getting the same error.

this is the code which is not working in postgresql only,we are using the same code in oracle and sql server,which is working. yes i executed the same query on ppas, it's executing without any error. Before this we have executed on statement which give error but after that we have closed the connection

please help me?



Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block

indicates that a previous statement failed, and your code did not trap the exception and issue a ROLLBACK. So it's trying to continue to use a transaction that's in the aborted state.

PostgreSQL requires an explicit ROLLBACK after a failed statement when autocommit is off. It will never implicitly rollback and start a new transaction. It can't ignore statements with errors and continue with the transaction - the whole transaction must be aborted and retried (unless you manually use savepoints).

This is different to many databases, so it has probably exposed an underlying bug in the code where it does something that causes an ERROR, then ignores the error and carries on. Look at the PostgreSQL server error logs to see what the first error was, and what statement it was.

After doing so much googling and R&D from more than one month finally i got success to fix the above described common error of postgresql 9.3 by setting the value of "edb_stmt_level_tx = off" to "on" in PPAS9.3 postgresql.config property file. For more information please visit below given link. for more information please visit this link

Need Your Help

Why doesn't my C code snippet work? Simplistic version does. Passing args without VA_ARGS for unsigned long long

c stack parameter-passing

Basically I'm writing a printf function for an dedicated system so I want to pass an optional number of arguments without using VA_ARGS macros. I knocked up a simple example and this block of code ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.