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"