Hi coloradoflyer, I'm not an expert with hsql, but I don't see anything "wrong" with your configuration. From your description, your application works just fine with PostgreSQL? But, just changing the database configuration to HSQL, then it fails? And, there are no errors getting posted? If no errors are being logged, then my guess is that OpenJPA is (accidentally) writing to a different database than what you think is configured.
Have you tried turning on TRACE for openjpa.log? That would show what database and what tables are being used. This would also show the SQL that is being pushed out to the database, along with any errors that might have occurred. I'd start with that for debugging. Good luck, Kevin On Wed, Oct 21, 2009 at 11:28 PM, coloradoflyer <[email protected]>wrote: > > Hi all, > > I'm writing an application that currently runs in both HSQL and PostgresQL, > really it should run in any db, but those 2 are ones I have currently > tested. > > I'm using openejb (Embedded), and openjpa-2.1. The problem is, when I run > against HSQL and I create a new entity (seems like any row for any entity), > then shutdown my application shortly (within a second or 2) after creating > the row, that row never gets persisted or written out to the log or script > file. > > The application is a swing app, and I set the main window closing to exit > the app, I'm assuming this should cause a standard shutdown. > > I've looked in the hsql configuration docs and do not seen anything that > seems to be obvious (to me). This seems to be a basic flush problem, but > I'm not sure what to change to get things to flush. > > I did create a shutdown hook and did a shutdown of openejb, but that did > not > fix things. Any help is greatly appreciated > > -chris > > my openejb config file has the following DataSources created: > > <Resource id="myDatabase" type="DataSource"> > JdbcDriver org.hsqldb.jdbcDriver > JdbcUrl jdbc:hsqldb:file:db/mydb > JtaManaged true > </Resource> > <Resource id="myDatabaseUnmanaged" type="DataSource"> > JdbcDriver org.hsqldb.jdbcDriver > JdbcUrl jdbc:hsqldb:file:db/mydb > JtaManaged false > </Resource> > > and in my persistence.xml file I have: > <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> > <persistence-unit name="mydb-unit" transaction-type="JTA"> > <jta-data-source>myDatabase</jta-data-source> > <property name="openjpa.Log" value="DefaultLevel=ERROR" /> > <property name="openjpa.jdbc.SchemaFactory" > value="native(ForeignKeys=true)"/> > <property name="openjpa.AutoDetach" value="commit"/> > <property name="openjpa.RetainState" value="false"/> > <property name="openjpa.DetachState" value="fetch-groups"/> > </properties> > </persistence-unit> > </persistence> > > -- > View this message in context: > http://n2.nabble.com/HSQL-update-problem-tp3870187p3870187.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
