You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Brian Sayatovic <tr...@trinition.org> on 2008/01/04 01:13:20 UTC

Why might embedded Derby not preserve state?

I'm trying to run XWiki Enterprise with embedded Derby (via XWiki's use of
Hibernate) under Tomcat 5.  I first tried this a couple of months ago, and
have just tried again using the latest release of Derby ( 10.3.2.1).

I can start the application just fine, add content, browse it, etc.  When I
then shut down Tomcat and start it again, all of my content is gone.

I doubt it is a global flaw in XWiki because I've got it working fine with
another DB.  I'm also fairly certain its not a blatant problem in Derby
since it would be so fatal.

Instead, I suspect its an unexpected interaction.  So what sort of things
might be causing this?  Any ideas on what I could look for?

Regards,
Brian.

Re: Why might embedded Derby not preserve state?

Posted by Kristian Waagan <Kr...@Sun.COM>.
Michael J. Vinca wrote:
> Where are you storing your Derby database? Is it being made in a 
> temporary directory of Tomcat?

Hello,

This sounds like a plausible explanation. A few related things to check:
  - Have you specified derby.system.home?
  - Are you using absolute paths in the connection URL?
  - Can you verify where the database is created?

> 
> - OR - 
> 
> Are you specifying to create the database when you startup, thereby 
> overwriting what you previously had?

The database will not be overwritten if you specifiy create=true and 
point to an existing database. You will only get a SQL warning. In ij it 
is displayed like this:

"WARNING 01J01: Database '/tmp/testDB' not created, connection made to 
existing database instead."

Note that you will have to check for, or handle, warnings yourself. 
Warnings can be retrieved from Connection, Statement and ResultSet objects.

Further, make sure something else (like an application or framework 
specific mechanism) isn't deleting/recreating your tables.



regards,
-- 
Kristian

> 
> Just some thoughts...
> 
> ~Mike Vinca
> _______________________________________________
> Signature of exoflare:
> Trying to stop AIDS by handing out condoms is like trying to end murder 
> by handing out bullet-proof vests.
> 
> 
> 
> On Jan 3, 2008, at 7:13 PM, Brian Sayatovic wrote:
> 
>> I'm trying to run XWiki Enterprise with embedded Derby (via XWiki's 
>> use of Hibernate) under Tomcat 5.  I first tried this a couple of 
>> months ago, and have just tried again using the latest release of 
>> Derby ( 10.3.2.1 <http://10.3.2.1/>).
>>
>> I can start the application just fine, add content, browse it, etc.  
>> When I then shut down Tomcat and start it again, all of my content is 
>> gone.
>>
>> I doubt it is a global flaw in XWiki because I've got it working fine 
>> with another DB.  I'm also fairly certain its not a blatant problem in 
>> Derby since it would be so fatal.
>>
>> Instead, I suspect its an unexpected interaction.  So what sort of 
>> things might be causing this?  Any ideas on what I could look for?
>>
>> Regards,
>> Brian.
> 


Re: Why might embedded Derby not preserve state?

Posted by "Michael J. Vinca" <mi...@gmail.com>.
Where are you storing your Derby database? Is it being made in a  
temporary directory of Tomcat?

- OR -

Are you specifying to create the database when you startup, thereby  
overwriting what you previously had?

Just some thoughts...

~Mike Vinca
_______________________________________________
Signature of exoflare:
Trying to stop AIDS by handing out condoms is like trying to end  
murder by handing out bullet-proof vests.



On Jan 3, 2008, at 7:13 PM, Brian Sayatovic wrote:

> I'm trying to run XWiki Enterprise with embedded Derby (via XWiki's  
> use of Hibernate) under Tomcat 5.  I first tried this a couple of  
> months ago, and have just tried again using the latest release of  
> Derby ( 10.3.2.1).
>
> I can start the application just fine, add content, browse it,  
> etc.  When I then shut down Tomcat and start it again, all of my  
> content is gone.
>
> I doubt it is a global flaw in XWiki because I've got it working  
> fine with another DB.  I'm also fairly certain its not a blatant  
> problem in Derby since it would be so fatal.
>
> Instead, I suspect its an unexpected interaction.  So what sort of  
> things might be causing this?  Any ideas on what I could look for?
>
> Regards,
> Brian.