The database remains empty. Although the schema appears to be generated in the output from "ant schema".
I'm trying to execute the tutorials and sample applications of hibernate. Things are getting executed smoothly with no major exceptions/errors. Get to see SQL statements of creating tables, inserting rows etc. too.
The executed applications also creates .lck, script, .log etc. files too. However, when connected to database using "DatabaseManager", I don't get to see the created tables and/or inserted rows etc.
"java org.hsqldb.util.DatabaseManager -driver org.hsqldb.jdbcDriver -url jdbc:hsqldb:data/auction -user sa"
I just get to see the db properties.
I desperately need some help on this. Tried N samples/tutorials. Nothing resulted in successfull db ojects creation and data handling.
Awaiting eagerly for any kind of support to get rid of this issue and proceed further.
Hibernate version: hibernate-3.1.3
Mapping documents: AuctionItem.hbm.xml, Bid.hbm.xml, User.hbm.xml
Code between sessionFactory.openSession() and session.close():
Session s = factory.openSession();
Transaction tx = s.beginTransaction();
User seller = new User();
seller.setUserName("xam");
seller.setName( new Name("Max", new Character('R'), "Andersen") );
seller.setEmail("max@hibernate.org");
seller.setPassword("******");
seller.setAuctions( new ArrayList() );
s.save(seller);
tx.commit();
s.close();
Full stack trace of any exception that occurs: NONE
Name and version of the database you are using: hsqldb_1_8_0_2
The generated SQL (show_sql=true):
[java] 19:12:50,000 DEBUG SchemaExport:301 -
[java] drop table AuctionItem if exists
[java] 19:12:50,031 DEBUG SchemaExport:301 -
[java] drop table AuctionUser if exists
[java] 19:12:50,156 DEBUG SchemaExport:301 -
[java] drop table Bid if exists
[java] 19:12:50,156 DEBUG SchemaExport:301 -
[java] create table AuctionItem (
[java] id bigint generated by default as identity (start with 1),
[java] seller bigint not null,
[java] shortDescription varchar(200) not null,
[java] description varchar(1000),
[java] ends timestamp,
[java] "CONDITION" integer,
[java] successfulBid bigint,
[java] primary key (id),
[java] unique (seller, shortDescription)
[java] )
[java] 19:12:50,187 DEBUG SchemaExport:301 -
[java] create table AuctionUser (
[java] id bigint generated by default as identity (start with 1),
[java] userName varchar(10) not null,
[java] "password" varchar(15) not null,
[java] email varchar(255),
[java] firstName varchar(50) not null,
[java] "initial" char(1),
[java] lastName varchar(50) not null,
[java] primary key (id),
[java] unique (userName)
[java] )
[java] 19:12:50,234 DEBUG SchemaExport:301 -
[java] create table Bid (
[java] id bigint generated by default as identity (start with 1),
[java] isBuyNow char(1) not null,
[java] item bigint not null,
[java] amount float not null,
[java] "datetime" timestamp not null,
[java] bidder bigint not null,
[java] primary key (id),
[java] unique (item, amount)
[java] )
[java] 19:12:50,265 DEBUG SchemaExport:301 -
[java] alter table AuctionItem
[java] add constraint FK522A9BD6F65B1FAF
[java] foreign key (successfulBid)
[java] references Bid
[java] 19:12:50,296 DEBUG SchemaExport:301 -
[java] alter table AuctionItem
[java] add constraint FK522A9BD61107FE9B
[java] foreign key (seller)
[java] references AuctionUser
[java] 19:12:50,312 DEBUG SchemaExport:301 -
[java] alter table Bid
[java] add constraint FK104DDF43A3910
[java] foreign key (bidder)
[java] references AuctionUser
[java] 19:12:50,312 DEBUG SchemaExport:301 -
[java] alter table Bid
[java] add constraint FK104DDEE6E7E98
[java] foreign key (item)
[java] references AuctionItem
[java] 19:12:50,343 INFO SchemaExport:194 - schema export complete
[java] Setting up some test data
[java] Hibernate:
[java] insert
[java] into
[java] AuctionUser
[java] (userName, "password", email, firstName, "initial", lastName
id)
[java] values
[java] (?, ?, ?, ?, ?, ?, null)
[java] Hibernate:
[java] call identity()
[java] Hibernate:
[java] select
[java] this_.id as id0_0_,
[java] this_.seller as seller0_0_,
[java] this_.shortDescription as shortDes3_0_0_,
[java] this_.description as descript4_0_0_,
[java] this_.ends as ends0_0_,
[java] this_."CONDITION" as CONDITION6_0_0_,
[java] this_.successfulBid as successf7_0_0_
[java] from
[java] AuctionItem this_
[java] where
[java] (
[java] lower(this_.description) like ?
[java] and this_."CONDITION"=?
[java] )
[java] Viewing auctions containing: DESC with condition: 8/10
[java] Item: 3 - new description
[java] 19:13:56,031 INFO SessionFactoryImpl:729 - closing
[java] 19:13:56,031 INFO DriverManagerConnectionProvider:147 - cleaning up
connection pool: jdbc:hsqldb:data/auction
[echo] Please follow the Getting Started road map:
http://www.hibernate.org
/152.html
Debug level Hibernate log excerpt: log4j.logger.org.hibernate.SQL=debug
--------------------------------------------------------------------------------