Hi,
we've got some trouble running Hibernate in Glassfish using "create-drop" or development usage. Before switching to Postgres everything worked fine but with Postgres Hibernate sometimes hangs forever while recreating the database tables after a redeploy.
I've used pgAdmin III to get an overview of what's going on on the Postgres server if this problem occurs and noticed that there is one active transaction that doesn't end. The query executed there is
"alter table ContactRequests drop constraint fk6add7fe488265814"
The sql statement for this table is:
Code:
CREATE TABLE contactrequests
(
messageid bigserial NOT NULL,
sent timestamp without time zone NOT NULL,
state integer,
recipient_userid bigint NOT NULL,
sender_userid bigint NOT NULL,
CONSTRAINT contactrequests_pkey PRIMARY KEY (messageid),
CONSTRAINT fk6add7fe488265814 FOREIGN KEY (sender_userid)
REFERENCES users (userid) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk6add7fe4dcf117b0 FOREIGN KEY (recipient_userid)
REFERENCES users (userid) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (OIDS=FALSE);
ALTER TABLE contactrequests OWNER TO glassfish;
This problem occurs using the latest stable Hibernate version (+ anotations and entity manager) and on Postgres 8.2 and 8.3.
Is this some problem of our table structure or a Hibernate problem?
Thanks for the help
Johannes