-->
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.  [ 13 posts ] 
Author Message
 Post subject: Hibernate and Firebird - eg problem
PostPosted: Mon Jan 05, 2004 12:59 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
Hi All,

I have a problem with running example in hibernate-2.1.1 and Firebird1.0.
I followed readme.txt:
(1) copy your JayBird JDBC driver to the lib directory
(2) edit src/hibernate.properties
(3) run "ant eg"
and got a lot of errors - see log below.
In DB I can see 3 tables created - AUCTIONITEM, AUCTIONUSER, BID (filled
with data even) and a generator HIBERNATE_SEQUENCE.

Does Hibernate have problems with Firebird?

Best regards,
Sergei Volin.


===========
1. My hibernate.properties:
## Firebird

hibernate.dialect net.sf.hibernate.dialect.FirebirdDialect
hibernate.connection.username sysdba
hibernate.connection.password xxxxxxxx

## JayBird

hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
hibernate.connection.url jdbc:firebirdsql://localhost:3050/F:\ACI-NA\Hibernate\hibernate.gdb

2. Log:
Buildfile: build.xml
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[echo] remember to place your JDBC driver in the lib directory
[java] 16:48:45,551 INFO Environment:432 - Hibernate 2.1.1
[java] 16:48:45,601 INFO Environment:466 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.firebirdsql.jdbc.FBDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.FirebirdDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=sysdba, hibernate.connection.url=jdbc:firebirdsql://localhost:3050/F:\ACI-NA\Hibernate\hibernate.gdb, hibernate.connection.password=xxxxxxxx, hibernate.connection.pool_size=1}
[java] 16:48:45,601 INFO Environment:480 - using java.io streams to persist binary types
[java] 16:48:45,601 INFO Environment:481 - using CGLIB reflection optimizer
[java] 16:48:45,671 INFO Configuration:318 - Mapping resource: org/hibernate/auction/AuctionItem.hbm.xml
[java] 16:48:46,703 INFO Binder:225 - Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
[java] 16:48:46,963 INFO Configuration:318 - Mapping resource: org/hibernate/auction/Bid.hbm.xml
[java] 16:48:47,053 INFO Binder:225 - Mapping class: org.hibernate.auction.Bid -> Bid
[java] 16:48:47,123 INFO Binder:169 - Mapping subclass: org.hibernate.auction.BuyNow -> Bid
[java] 16:48:47,123 INFO Configuration:318 - Mapping resource: org/hibernate/auction/User.hbm.xml
[java] 16:48:47,224 INFO Binder:225 - Mapping class: org.hibernate.auction.User -> AuctionUser
[java] 16:48:47,534 INFO ReflectHelper:160 - reflection optimizer disabled for: org.hibernate.auction.Name, IllegalArgumentException: Cannot find matching method/constructor
[java] 16:48:47,554 INFO Configuration:584 - processing one-to-many association mappings
[java] 16:48:47,554 INFO Binder:1139 - Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
[java] 16:48:47,554 INFO Binder:1139 - Mapping collection: org.hibernate.auction.User.bids -> Bid
[java] 16:48:47,554 INFO Binder:1139 - Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
[java] 16:48:47,554 INFO Configuration:593 - processing one-to-one association property references
[java] 16:48:47,554 INFO Configuration:618 - processing foreign key constraints
[java] 16:48:47,584 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.FirebirdDialect
[java] 16:48:47,584 INFO SettingsFactory:58 - Maximim outer join fetch depth: 1
[java] 16:48:47,584 INFO SettingsFactory:62 - Use outer join fetching: true
[java] 16:48:47,594 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 16:48:47,624 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 16:48:47,634 INFO DriverManagerConnectionProvider:71 - using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebirdsql://localhost:3050/F:\ACI-NA\Hibernate\hibernate.gdb
[java] 16:48:47,634 INFO DriverManagerConnectionProvider:72 - connection properties: {user=sysdba, password=xxxxxxxx}
[java] 16:48:47,654 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
[java] 16:48:48,005 INFO SettingsFactory:89 - Use scrollable result sets: false
[java] 16:48:48,005 INFO SettingsFactory:99 - Query language substitutions: {no='N', true=1, yes='Y', false=0}
[java] 16:48:48,015 INFO SettingsFactory:110 - cache provider: net.sf.hibernate.cache.HashtableCacheProvider
[java] 16:48:48,015 INFO Configuration:1057 - instantiating and configuring caches
[java] 16:48:48,065 INFO SessionFactoryImpl:119 - building session factory
[java] 16:48:48,786 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
[java] 16:48:48,806 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.FirebirdDialect
[java] 16:48:48,806 INFO Configuration:584 - processing one-to-many association mappings
[java] 16:48:48,806 INFO Configuration:593 - processing one-to-one association property references
[java] 16:48:48,806 INFO Configuration:618 - processing foreign key constraints
[java] 16:48:48,806 INFO Configuration:584 - processing one-to-many association mappings
[java] 16:48:48,826 INFO Configuration:593 - processing one-to-one association property references
[java] 16:48:48,826 INFO Configuration:618 - processing foreign key constraints
[java] 16:48:48,836 INFO SchemaExport:98 - Running hbm2ddl schema export
[java] 16:48:48,836 INFO SchemaExport:117 - exporting generated schema to database
[java] 16:48:48,836 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 16:48:48,836 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 16:48:48,836 INFO DriverManagerConnectionProvider:71 - using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebirdsql://localhost:3050/F:\ACI-NA\Hibernate\hibernate.gdb
[java] 16:48:48,836 INFO DriverManagerConnectionProvider:72 - connection properties: {user=sysdba, password=xxxxxxxx}
[java] 16:48:48,876 DEBUG SchemaExport:132 - alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 16:48:49,126 DEBUG SchemaExport:137 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 16:48:49,126 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,126 DEBUG SchemaExport:132 - alter table AuctionItem drop constraint FK522A9BD657291C03
[java] 16:48:49,126 DEBUG SchemaExport:137 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD657291C03
[java] 16:48:49,126 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,146 DEBUG SchemaExport:132 - alter table Bid drop constraint FK104DD317B13
[java] 16:48:49,156 DEBUG SchemaExport:137 - Unsuccessful: alter table Bid drop constraint FK104DD317B13
[java] 16:48:49,156 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,166 DEBUG SchemaExport:132 - alter table Bid drop constraint FK104DDAD3189F4
[java] 16:48:49,176 DEBUG SchemaExport:137 - Unsuccessful: alter table Bid drop constraint FK104DDAD3189F4
[java] 16:48:49,176 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,176 DEBUG SchemaExport:132 - drop table AuctionItem
[java] 16:48:49,176 DEBUG SchemaExport:137 - Unsuccessful: drop table AuctionItem
[java] 16:48:49,176 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,186 DEBUG SchemaExport:132 - drop table AuctionUser
[java] 16:48:49,186 DEBUG SchemaExport:137 - Unsuccessful: drop table AuctionUser
[java] 16:48:49,186 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,186 DEBUG SchemaExport:132 - drop table Bid
[java] 16:48:49,206 DEBUG SchemaExport:137 - Unsuccessful: drop table Bid
[java] 16:48:49,206 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,206 DEBUG SchemaExport:132 - drop generator hibernate_sequence
[java] 16:48:49,216 DEBUG SchemaExport:137 - Unsuccessful: drop generator hibernate_sequence
[java] 16:48:49,216 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Generator not found
[java] 16:48:49,216 DEBUG SchemaExport:149 - create table AuctionItem (
[java] id NUMERIC(18,0) not null,
[java] description VARCHAR(255),
[java] ends TIMESTAMP,
[java] condition INTEGER,
[java] seller NUMERIC(18,0) not null,
[java] successfulBid NUMERIC(18,0),
[java] primary key (id)
[java] )
[java] 16:48:49,307 DEBUG SchemaExport:149 - create table AuctionUser (id NUMERIC(18,0) not null, userName VARCHAR(255) not null, "password" VARCHAR(255), email VARCHAR(255), firstName VARCHAR(255), "initial" CHAR(1), lastName VARCHAR(255), primary key (id))
[java] 16:48:49,377 DEBUG SchemaExport:149 - create table Bid (
[java] id NUMERIC(18,0) not null,
[java] isBuyNow CHAR(1) not null,
[java] amount FLOAT not null,
[java] datetime TIMESTAMP not null,
[java] bidder NUMERIC(18,0) not null,
[java] item NUMERIC(18,0) not null,
[java] primary key (id)
[java] )
[java] 16:48:49,417 DEBUG SchemaExport:149 - alter table AuctionItem add constraint FK522A9BD6C9FF4F7F foreign key (seller) references AuctionUser
[java] 16:48:49,447 ERROR SchemaExport:154 - Unsuccessful: alter table AuctionItem add constraint FK522A9BD6C9FF4F7F foreign key (seller) references AuctionUser
[java] 16:48:49,447 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONUSER is in use
[java] 16:48:49,447 DEBUG SchemaExport:149 - alter table AuctionItem add constraint FK522A9BD657291C03 foreign key (successfulBid) references Bid
[java] 16:48:49,487 ERROR SchemaExport:154 - Unsuccessful: alter table AuctionItem add constraint FK522A9BD657291C03 foreign key (successfulBid) references Bid
[java] 16:48:49,487 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object BID is in use
[java] 16:48:49,487 DEBUG SchemaExport:149 - alter table Bid add constraint FK104DD317B13 foreign key (item) references AuctionItem
[java] 16:48:49,527 ERROR SchemaExport:154 - Unsuccessful: alter table Bid add constraint FK104DD317B13 foreign key (item) references AuctionItem
[java] 16:48:49,527 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONITEM is in use
[java] 16:48:49,527 DEBUG SchemaExport:149 - alter table Bid add constraint FK104DDAD3189F4 foreign key (bidder) references AuctionUser
[java] 16:48:49,567 ERROR SchemaExport:154 - Unsuccessful: alter table Bid add constraint FK104DDAD3189F4 foreign key (bidder) references AuctionUser
[java] 16:48:49,577 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONUSER is in use
[java] 16:48:49,577 DEBUG SchemaExport:149 - create generator hibernate_sequence
[java] 16:48:49,597 INFO SchemaExport:160 - schema export complete
[java] 16:48:49,597 INFO DriverManagerConnectionProvider:137 - cleaning up connection pool: jdbc:firebirdsql://localhost:3050/F:\ACI-NA\Hibernate\hibernate.gdb
[java] Setting up some test data
[java] Viewing all auction item objects
[java] Auction: 8 - auction item 2, ends: 2004-01-05 16:48:49.807, bids: [1E1 $0.0, 1E1 $1.0, izi $0.5, izi $1.0 (buy now), izi $1.5]
[java] Auction: 5 - auction item 1, ends: 2004-01-05 16:48:49.807, bids: [1E1 $0.0, izi $0.5]
[java] Auction: 4 - auction item 0, ends: 2004-01-05 16:48:49.807, bids: []

[java] Viewing all auction item info
[java] Auction: 5 - auction item 1, ends: 2004-01-05 16:48:49.807, highest bid: 0.5
[java] Auction: 8 - auction item 2, ends: 2004-01-05 16:48:49.807, highest bid: 1.5
[java] Auction: 4 - auction item 0, ends: 2004-01-05 16:48:49.807, highest bid: null

[java] Creating a new bid for auction item: 8 by user: 3
[java] Viewing all auction item info
[java] Auction: 5 - auction item 1, ends: 2004-01-05 16:48:49.807, highest bid: 0.5
[java] Auction: 8 - auction item 2, ends: 2004-01-05 16:48:49.807, highest bid: 5.5
[java] Auction: 4 - auction item 0, ends: 2004-01-05 16:48:49.807, highest bid: null

[java] Viewing user and auctions: 1
[java] User: 1 - ol' dirty bastard, email: oldirty@hibernate.org, auctions: [auction item 0 (2/10), auction item 1 (5/10), auction item 2 (8/10)]
[java] Changing user details for: 1
[java] Changing auction item description for: 8
[java] Viewing user and auctions: 1
[java] User: 1 - ol' dirty bastard, email: oldirty@jboss.org, auctions: [auction item 0 (2/10), auction item 1 (5/10), new description (8/10)]
[java] 16:48:50,498 WARN JDBCExceptionReporter:38 - SQL Error: 335544569, SQLState: null
[java] 16:48:50,498 ERROR JDBCExceptionReporter:46 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] 16:48:50,498 WARN JDBCExceptionReporter:38 - SQL Error: 335544569, SQLState: null
[java] 16:48:50,498 ERROR JDBCExceptionReporter:46 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] 16:48:50,498 ERROR JDBCExceptionReporter:38 - SQLException occurred
[java] org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] at
[java] org.firebirdsql.gds.GDSException: Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1698)
[java] at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1651)
[java] at org.firebirdsql.jgds.GDS_Impl.isc_dsql_prepare(GDS_Impl.java:1162)
[java] at org.firebirdsql.jca.FBManagedConnection.prepareSQL(FBManagedConnection.java:767)
[java] at org.firebirdsql.jdbc.FBConnection.prepareSQL(FBConnection.java:1107)
[java] at org.firebirdsql.jdbc.FBStatement.prepareFixedStatement(FBStatement.java:942)
[java] at org.firebirdsql.jdbc.FBPreparedStatement.prepareFixedStatement(FBPreparedStatement.java:699)
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:78)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] net.sf.hibernate.JDBCException: SQLException occurred
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3443)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] ... 3 more
[java] Exception in thread "main"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please set hibernate.show_sql = true in your properties file, and check which SQL is generated by hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:39 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
The errors and sql are actually obvious from this log. I don't know the business logic of this example but as I can guess:
1. The 1st group of errors arised from an attempt to drop constraints and tables probably created before - just remove old objects if exist.
-->
[java] 16:48:48,876 DEBUG SchemaExport:132 - alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 16:48:49,126 DEBUG SchemaExport:137 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 16:48:49,126 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,126 DEBUG SchemaExport:132 - alter table AuctionItem drop constraint FK522A9BD657291C03
[java] 16:48:49,126 DEBUG SchemaExport:137 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD657291C03
[java] 16:48:49,126 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,146 DEBUG SchemaExport:132 - alter table Bid drop constraint FK104DD317B13
[java] 16:48:49,156 DEBUG SchemaExport:137 - Unsuccessful: alter table Bid drop constraint FK104DD317B13
[java] 16:48:49,156 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,166 DEBUG SchemaExport:132 - alter table Bid drop constraint FK104DDAD3189F4
[java] 16:48:49,176 DEBUG SchemaExport:137 - Unsuccessful: alter table Bid drop constraint FK104DDAD3189F4
[java] 16:48:49,176 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Table column not found
[java] 16:48:49,176 DEBUG SchemaExport:132 - drop table AuctionItem
[java] 16:48:49,176 DEBUG SchemaExport:137 - Unsuccessful: drop table AuctionItem
[java] 16:48:49,176 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,186 DEBUG SchemaExport:132 - drop table AuctionUser
[java] 16:48:49,186 DEBUG SchemaExport:137 - Unsuccessful: drop table AuctionUser
[java] 16:48:49,186 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,186 DEBUG SchemaExport:132 - drop table Bid
[java] 16:48:49,206 DEBUG SchemaExport:137 - Unsuccessful: drop table Bid
[java] 16:48:49,206 DEBUG SchemaExport:138 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -607
[java] No message for code 336068783 found.
[java] null
[java] 16:48:49,206 DEBUG SchemaExport:132 - drop generator hibernate_sequence
[java] 16:48:49,216 DEBUG SchemaExport:137 - Unsuccessful: drop generator hibernate_sequence
[java] 16:48:49,216 DEBUG SchemaExport:138 - GDS Exception. unsuccessful metadata update
[java] Generator not found
<--
2. The 2nd group of errors appeared after new tables created when trying to alter new tables to create foreign keys constraints but failed due to 'Object is in use'. It means that example does not properly close connection before trying to alter tables. Is it?
-->
[java] 16:48:49,417 DEBUG SchemaExport:149 - alter table AuctionItem add constraint FK522A9BD6C9FF4F7F foreign key (seller) references AuctionUser
[java] 16:48:49,447 ERROR SchemaExport:154 - Unsuccessful: alter table AuctionItem add constraint FK522A9BD6C9FF4F7F foreign key (seller) references AuctionUser
[java] 16:48:49,447 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONUSER is in use
[java] 16:48:49,447 DEBUG SchemaExport:149 - alter table AuctionItem add constraint FK522A9BD657291C03 foreign key (successfulBid) references Bid
[java] 16:48:49,487 ERROR SchemaExport:154 - Unsuccessful: alter table AuctionItem add constraint FK522A9BD657291C03 foreign key (successfulBid) references Bid
[java] 16:48:49,487 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object BID is in use
[java] 16:48:49,487 DEBUG SchemaExport:149 - alter table Bid add constraint FK104DD317B13 foreign key (item) references AuctionItem
[java] 16:48:49,527 ERROR SchemaExport:154 - Unsuccessful: alter table Bid add constraint FK104DD317B13 foreign key (item) references AuctionItem
[java] 16:48:49,527 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONITEM is in use
[java] 16:48:49,527 DEBUG SchemaExport:149 - alter table Bid add constraint FK104DDAD3189F4 foreign key (bidder) references AuctionUser
[java] 16:48:49,567 ERROR SchemaExport:154 - Unsuccessful: alter table Bid add constraint FK104DDAD3189F4 foreign key (bidder) references AuctionUser
[java] 16:48:49,577 ERROR SchemaExport:155 - GDS Exception. unsuccessful metadata update
[java] object AUCTIONUSER is in use
<--
3. The 3rd error - Function unknown LOWER. With hibernate.show_sql = true this peice of log is as follows:
[java] Viewing user and auctions: 1
[java] Hibernate: select this.id as id1_, this.userName as userName1_, this."password" as y3_1_, this.email as email1_, this.firstName as firstName1_, this."initial" as y6_1_, this.lastName as lastName1_, auctions1_.id as id__, auctions1_.seller as seller__, auctions1_.id as id0_, auctions1_.description as descript2_0_, auctions1_.ends as ends0_, auctions1_.condition as condition0_, auctions1_.seller as seller0_, auctions1_.successfulBid as successf6_0_ from AuctionUser this left outer join AuctionItem auctions1_ on this.id=auctions1_.seller where this.id=?
[java] User: 1 - ol' dirty bastard, email: oldirty@hibernate.org, auctions: [auction item 0 (2/10), auction item 1 (5/10), auction item 2 (8/10)]
[java] Changing user details for: 1
[java] Hibernate: update AuctionUser set userName=?, "password"=?, email=?, firstName=?, "initial"=?, lastName=? where id=?
[java] Hibernate: update AuctionItem set description=?, ends=?, condition=?, seller=?, successfulBid=? where id=?
[java] Hibernate: update Bid set amount=?, datetime=?, bidder=?, item=? where id=?
[java] Hibernate: update AuctionItem set description=?, ends=?, condition=?, seller=?, successfulBid=? where id=?
[java] Hibernate: update Bid set amount=?, datetime=?, bidder=?, item=? where id=?
[java] Changing auction item description for: 8
[java] Hibernate: select auctionite0_.id as id0_, auctionite0_.description as descript2_0_, auctionite0_.ends as ends0_, auctionite0_.condition as condition0_, auctionite0_.seller as seller0_, auctionite0_.successfulBid as successf6_0_ from AuctionItem auctionite0_ where auctionite0_.id=?
[java] Hibernate: update AuctionItem set description=?, ends=?, condition=?, seller=?, successfulBid=? where id=?
[java] Viewing user and auctions: 1
[java] Hibernate: select this.id as id1_, this.userName as userName1_, this."password" as y3_1_, this.email as email1_, this.firstName as firstName1_, this."initial" as y6_1_, this.lastName as lastName1_, auctions1_.id as id__, auctions1_.seller as seller__, auctions1_.id as id0_, auctions1_.description as descript2_0_, auctions1_.ends as ends0_, auctions1_.condition as condition0_, auctions1_.seller as seller0_, auctions1_.successfulBid as successf6_0_ from AuctionUser this left outer join AuctionItem auctions1_ on this.id=auctions1_.seller where this.id=?
[java] User: 1 - ol' dirty bastard, email: oldirty@jboss.org, auctions: [auction item 0 (2/10), auction item 1 (5/10), new description (8/10)]
[java] Hibernate: select this.id as id0_, this.description as descript2_0_, this.ends as ends0_, this.condition as condition0_, this.seller as seller0_, this.successfulBid as successf6_0_ from AuctionItem this where (lower(this.description) like ?)
[java] 19:01:52,105 WARN JDBCExceptionReporter:38 - SQL Error: 335544569, SQLState: null
[java] 19:01:52,105 ERROR JDBCExceptionReporter:46 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] 19:01:52,105 WARN JDBCExceptionReporter:38 - SQL Error: 335544569, SQLState: null
[java] 19:01:52,115 ERROR JDBCExceptionReporter:46 - GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] 19:01:52,115 ERROR JDBCExceptionReporter:38 - SQLException occurred
[java] org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] at
[java] org.firebirdsql.gds.GDSException: Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1698)
[java] at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1651)
[java] at org.firebirdsql.jgds.GDS_Impl.isc_dsql_prepare(GDS_Impl.java:1162)
[java] at org.firebirdsql.jca.FBManagedConnection.prepareSQL(FBManagedConnection.java:767)
[java] at org.firebirdsql.jdbc.FBConnection.prepareSQL(FBConnection.java:1107)
[java] at org.firebirdsql.jdbc.FBStatement.prepareFixedStatement(FBStatement.java:942)
[java] at org.firebirdsql.jdbc.FBPreparedStatement.prepareFixedStatement(FBPreparedStatement.java:699)
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:78)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] net.sf.hibernate.JDBCException: SQLException occurred
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3443)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] at org.hibernate.auction.Main.viewAuctionsByDescription(Main.java:250)
[java] at org.hibernate.auction.Main.main(Main.java:378)
[java] Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
[java] SQL error code = -804
[java] Function unknown
[java] LOWER
[java] at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
[java] at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
[java] at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
[java] ... 3 more
[java] Exception in thread "main"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
1. and 2. are most likely firebird related - firebird is really picky about when it permits to change its foreign key constraints, etc. (single user mode i just say).

3. is however a real incompatibility of the application with firebird, the sql lower function is used in a query, which firebird does not support. You might get around this by changing the code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:45 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
There is no LOWER function in Firebird SQL (only UPPER). The LOWER function is used in WHERE clause of the following SQL:

[java] Hibernate: select this.id as id0_, this.description as descript2_0_, this.ends as ends0_, this.condition as condition0_, this.seller as seller0_, this.successfulBid as successf6_0_ from AuctionItem this where (lower(this.description) like ?)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:55 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
gloeglm wrote:
1. and 2. are most likely firebird related - firebird is really picky about when it permits to change its foreign key constraints, etc. (single user mode i just say).

agree:( i got such kind of diffliculties a lot when trying to drop objects in firebird from within my application. i had to wipe them afterwards in a single user mode mannually. really picky.

gloeglm wrote:
3. is however a real incompatibility of the application with firebird, the sql lower function is used in a query, which firebird does not support. You might get around this by changing the code.

well, as i see an example is not suit well for firebird. may be i'll be more lucky with hibernate when coding my own project.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:00 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
But the question is - using of that LOWER function, is it a property of Hibernate or just this particular example?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I would not think about using SchemaUpdate or hibernate.hbm2ddl.auto with Firebird, this will most likely cause Problems.

I use Firebird myself, too, and I have found it the best way to create the tables and constraints myself and let Hibernate just do the data management. No problems with this however.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:18 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
OK, thanks a lot for the quick prompt. I'm really new to Hibernate but not to Firebird. I like this DB and would like to use it with Hibernate. Running Hibernate example was my first experience and hope i'll find the way to use all the advantages of Hibernate and create really portable and efficient application that I have already but with my custom SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 8:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Reactivated this old thread, because I noticed it is very easy to get LOWER working on Firebird:

In the UDF-Subdirectory of the firebird install root directory is a sql-file called ib_udf.sql - just execute it on your database, and you have support for a lot of functions including LOWER (read the SQL file for a complete list)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 9:18 am 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
thanks a lot that you pointed me to udf library - it worths to know about it. the only correction is that ib_udf.sql is located in FIREBIRD_HOME/examples :-))


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 9:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Not in my Firebird distribution :) 1.5.0 Windows


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 10:19 am 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
Oh, then sorry! mine is 1.0 Windows (still waithing for 1.5 final releas).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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.