openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From coloradoflyer <open...@parallelsw.com>
Subject Re: HSQL update problem
Date Fri, 23 Oct 2009 21:33:20 GMT

Hi all,

Yes, this turned out to be somewhat of a known issue, I did not want to add
code to my application to specifically do the "SET WRITE_DELAY 1"... This
would be something in the code I would need to change when I switch out the
db's.  What I did end up doing as a work around is, after the db was
created, I added the command to the db.script file.  This way anytime I'm
using HSQL the WRITE_DELAY will get set for my app and I dont have anything
db specific in my code.

Once there is an HSQL v1.9 out and I get some time, I will add the command
do the url and see if that handles it.

Thanks for the suggestion and help out.  I will post again once I get things
moved to 1.9 to see about that workaround.

-chris


coloradoflyer 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-tp3870187p3881417.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message