-
1. Re: Seam managed Hibernate Session
gena Jun 10, 2008 3:50 PM (in response to frankyb)Hi Frank,
are you sure, your transactions were commited and data were persisted successfully? It seems that, you need to commit transactions and possible also to flush the hibernate session manually to get transactions commited and data synchronized.
If you use the create-drop also the schema will be deleted, excepting the case, when the schema doesn't match your model anymore. I think, in your case the hbm2ddl=
update
did work fine.Gena
-
2. Re: Seam managed Hibernate Session
frankyb Jun 10, 2008 4:15 PM (in response to frankyb)Hi,
thank you for your answer. The entities are saved to database, I can see them when I access the database with SQuirreL or another
database explorer
.
The code I use is as follows://inject session @In Session session; ... User user=new User(); user.setName("coolUser"); session.save(user); session.flush();
Do I have to care for anything concerning transactions? As mentioned, I disabled transaction management.
Cheers,
Frank -
3. Re: Seam managed Hibernate Session
mcoffin Jun 10, 2008 8:28 PM (in response to frankyb)Sounds like one of the
features
of HSQLDB.Memory tables are the default type when the CREATE TABLE command is used. Their data is held entirely in memory but any change to their structure or contents is written to the <dbname>.script file. The script file is read the next time the database is opened, and the MEMORY tables are recreated with all their contents.
Another possible cause, if your connecting like this:
Memory-Only Databases It is possible to run HSQLDB in a way that the database is not persistent and exists entirely in random access memory. As no information is written to disk, this mode should be used only for internal processing of application data, in applets or certain special applications. This mode is specified by the mem: protocol. Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:aname", "sa", "");
-
4. Re: Seam managed Hibernate Session
frankyb Jun 11, 2008 8:36 AM (in response to frankyb)OK, thank you for this information.
I thought when using HSQL in server mode the database would store the data on disk (and not only the schema...). But it looks like this assumption was wrong.
So I will try with another database.
Do you have any proposals for a small, lightweight database system that does not need any installation or administration (like e.g. mySQL does)?
--
Frank -
5. Re: Seam managed Hibernate Session
mcoffin Jun 11, 2008 4:17 PM (in response to frankyb)Sorry, your choices are pretty limited. Even HSQL requires some administration from time to time.
I highly recommend you read the documentation, it will save you a lot of time and frustration.
HSQL can store the information on disk. Create a properties file for the server and add the following property:
hsqldb.default_table_type=cached
Documentation for HSQL can be found here.