-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: 3.0 Beta 4, Firebird 1.5.2, can't run eg sample
PostPosted: Tue Mar 01, 2005 6:54 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:29 am
Posts: 26
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0 Beta 4

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: Firebird 1.5.2 (on Windows XP Professional)

The generated SQL (show_sql=true):

[java] 17:04:17,908 DEBUG SchemaExport:154 - alter table AuctionItem add constraint FK522A9BD61107FE9B foreign key (seller) references AuctionUser

Debug level Hibernate log excerpt:

[java] 17:06:00,746 ERROR SchemaExport:160 - Unsuccessful: alter table AuctionItem add constraint FK522A9BD61107FE9B foreign key (seller) references AuctionUser
[java] 17:06:00,746 ERROR SchemaExport:161 - Resource Exception. unsuccessful metadata update
[java] object AUCTIONUSER is in use
[java] Reason: unsuccessful metadata update
[java] object AUCTIONUSER is in use

I get the above error (and more) when I try to run 'ant eg'.

I've downloaded Hibernate 3.0 B4, Firebird 1.5.2 and JayBird for 1.4 JDK.

I've configured Firebird to expose the UDF's like 'lower' - initially I got a failure from that.

I'm using FirebirdDialect.

In your "Firebird Known Issues" I found this:

"If you are altering tables you should be in single user mode. This
can be achieved by running gfix -shut. It's also sufficient to have
only one database connection open (eg. immediately after starting the
application). If more than one connection is open, you will see
errors like "table is in use". To restart your database use gfix -
online."

I looked at 'gfix -shut' and I think what you're saying is that I
can shut down my database to see if there are other users using it?

But to address the problem itself, what does "you should be in single
user mode" mean? The paragraph above makes sense if only the admin
is altering tables on rare occasions, but I originally started
looking into this because the eg example makes 'alter
table' calls and it's failing.

And if I DO use Firebird in single user mode with Hibernate, does that
make Hibernate less useful in any way? Am I unable to use connection pools, for example?

There are also various failures if I do 'ant junitreport', among which a testcase named legacy.FooBarTest takes a VERY long time and eventually fails saying that an XML file is invalid. (I know, I should name the XML file but I've been waiting for it to fail for about 20 minutes now and I need to go. I'll leave it and you can ask me tomorrow.)

Thanks,
-Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 8:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Firebird only allowing certain DDL operations only in single-user mode makes SchemaExport basically useless - you have to make sure that you have only one database connection open when it runs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 8:55 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:29 am
Posts: 26
michael wrote:
Firebird only allowing certain DDL operations only in single-user mode makes SchemaExport basically useless - you have to make sure that you have only one database connection open when it runs.


I don't *think* there's another connection open as I'm running the sample, unless the sample itself spawns multiple threads - I can check that.

I'm working my way through the "Hibernate in Action" book, and I got to the point where it said that I should go ahead and download it and play around, but I'm still too early on to even know what SchemaExport does. If it's a core piece, then maybe we should consider other databases, but then if it's not a must-have, why put it in the sample...

I guess I'll keep reading - it sounds like I may have to know more than I really wanted to at this point just to get Hibernate and Firebird to play nice. We've used SAP DB in the past but we're looking into Firebird since the non-commercial version of SAP seems to have dead-ended since MySQL bought them. Would it be easier to point Hibernate at SAP while I'm just playing around?

Do you know if there are other gotchas we're likely to run into with Firebird? Am I going to have to become a Hibernate/Firebird guru just to keep them working together, or have to do things manually to the DB that Hibernate would take care of with other DBs?

Thanks,
-Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 3:31 am 
Newbie

Joined: Tue Feb 22, 2005 11:51 am
Posts: 18
Hibernate works very fine with the MySQL DB 4.1. The Database is very easy to configure. There is only one important thing: If you want to use foreign keys, you need the table-type "InnoDB".


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 4:20 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:29 am
Posts: 26
michael wrote:
Firebird only allowing certain DDL operations only in single-user mode makes SchemaExport basically useless - you have to make sure that you have only one database connection open when it runs.


As far as I understand, though, I am the only user trying to access the DB when I'm running 'ant eg', so I don't understand why the alter table doesn't work.

Does the sample itself spawn multiple threads?

-Jeff


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.