Re: PostgreSQL + hibernate

Lists: pgsql-general
From: "Myatluk Andrey" <Andrey(dot)Myatluk(at)bercut(dot)ru>
To: <pgsql-general(at)postgresql(dot)org>
Subject: PostgreSQL + hibernate
Date: 2006-01-31 07:13:05
Message-ID: CD481F25862BDF4EB3014619BACB38D8FEC2CF@master.office.bercut.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi!

I have an application, consisting of Struts 1.2 + Tomcat 5.5 + Hibernate
3.1 + PostgreSQL 8.1

The application is developed on WinXP and installed on Fedora Core 4.

On local machine everything works OK. Both databases are created from
the same script and application is the same.

But when installed on FC, I get the following exception:

Hibernate: select nextval ('hibernate_sequence') Jan 30, 2006 8:21:35 PM
org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: 25P02
Jan 30, 2006 8:21:35 PM org.hibernate.util.JDBCExceptionReporter
logExceptions
SEVERE: ERROR: current transaction is aborted, commands ignored until
end of transaction block Jan 30, 2006 8:21:35 PM

Although when I'm trying to call hibernate sequence it works fine.

twix=# select nextval ('public.hibernate_sequence'); nextval
---------
3
(1 row)

twix=# select nextval ('hibernate_sequence'); nextval
---------
4
(1 row)

The sequence was created with the following command:
twix=# create sequence hibernate_sequence; CREATE SEQUENCE

I don't see what the problem could be.

Because of the connectivity problem could not connect to remote database
with pgAdmin. But it's the question for the next post.

Andrey


From: Chris <dmagick(at)gmail(dot)com>
To: Myatluk Andrey <Andrey(dot)Myatluk(at)bercut(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL + hibernate
Date: 2006-01-31 07:25:35
Message-ID: 43DF10EF.3040205@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

Are you doing this as the same user that your application uses?

Maybe the application postgresql user doesn't have access to the
sequence but the default user you're connecting as does.

( You're connecting as a postgresql super-user because you have a '#' in
your command prompt - a regular user gets = ).

Myatluk Andrey wrote:
> Hi!
>
> I have an application, consisting of Struts 1.2 + Tomcat 5.5 + Hibernate
> 3.1 + PostgreSQL 8.1
>
> The application is developed on WinXP and installed on Fedora Core 4.
>
> On local machine everything works OK. Both databases are created from
> the same script and application is the same.
>
> But when installed on FC, I get the following exception:
>
> Hibernate: select nextval ('hibernate_sequence') Jan 30, 2006 8:21:35 PM
> org.hibernate.util.JDBCExceptionReporter logExceptions
> WARNING: SQL Error: 0, SQLState: 25P02
> Jan 30, 2006 8:21:35 PM org.hibernate.util.JDBCExceptionReporter
> logExceptions
> SEVERE: ERROR: current transaction is aborted, commands ignored until
> end of transaction block Jan 30, 2006 8:21:35 PM
>
> Although when I'm trying to call hibernate sequence it works fine.


From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Myatluk Andrey <Andrey(dot)Myatluk(at)bercut(dot)ru>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL + hibernate
Date: 2006-01-31 09:43:55
Message-ID: 1138700635.24321.73.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

The error you're seeing comes from before. You only see the fact that
there was an error, and postgres is ignoring your queries until you roll
back. I bet you have a glitch in your transaction handling code, like
opening a transaction, getting an error on it, hibernate throws an error
and you don't have a finally clause to roll back the transaction.

HTH,
Csaba.

On Tue, 2006-01-31 at 08:13, Myatluk Andrey wrote:
> Hi!
>
> I have an application, consisting of Struts 1.2 + Tomcat 5.5 + Hibernate
> 3.1 + PostgreSQL 8.1
>
> The application is developed on WinXP and installed on Fedora Core 4.
>
> On local machine everything works OK. Both databases are created from
> the same script and application is the same.
>
> But when installed on FC, I get the following exception:
>
> Hibernate: select nextval ('hibernate_sequence') Jan 30, 2006 8:21:35 PM
> org.hibernate.util.JDBCExceptionReporter logExceptions
> WARNING: SQL Error: 0, SQLState: 25P02
> Jan 30, 2006 8:21:35 PM org.hibernate.util.JDBCExceptionReporter
> logExceptions
> SEVERE: ERROR: current transaction is aborted, commands ignored until
> end of transaction block Jan 30, 2006 8:21:35 PM
>
> Although when I'm trying to call hibernate sequence it works fine.
>
> twix=# select nextval ('public.hibernate_sequence'); nextval
> ---------
> 3
> (1 row)
>
> twix=# select nextval ('hibernate_sequence'); nextval
> ---------
> 4
> (1 row)
>
> The sequence was created with the following command:
> twix=# create sequence hibernate_sequence; CREATE SEQUENCE
>
> I don't see what the problem could be.
>
> Because of the connectivity problem could not connect to remote database
> with pgAdmin. But it's the question for the next post.
>
> Andrey
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq


From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Myatluk Andrey <Andrey(dot)Myatluk(at)bercut(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL + hibernate
Date: 2006-01-31 21:49:50
Message-ID: 20060131214950.GC95850@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tue, Jan 31, 2006 at 10:13:05AM +0300, Myatluk Andrey wrote:
> SEVERE: ERROR: current transaction is aborted, commands ignored until
> end of transaction block Jan 30, 2006 8:21:35 PM

That error means something prior to that in the same transaction failed
and you haven't issued a rollback yet.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461