You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Suraj Batuwana <sb...@virtusa.com> on 2006/11/07 04:44:02 UTC

Can't the embedded mode of a Derby database boot from a dual JVMs

Hi All,
	I am a derby user but for my application I need some improved version of
Derby. 
	So I thought of writing to this group.
	
	For my application I need to access a single Derby database(using Embedded
mode) from 
		1. Data source( In a Websphere 6.0.2.5)
		2. Client application
		
	But when try to access the database it will throw exceptions like "Caused
by: java.sql.SQLException: Failed to start database
'E:\source\database\TestDB'" from a one of the place.
	
	I know this happens because Embedded, a Derby database can be booted only
from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client JVM
and server JVM), but when I used the Network mode there is no such an
issue.Is there a way future Derby (Embedded mode) version can handle the
above issue or It will remain as it is ?

Please, this is very important for the progress of my application. 
	
If it is remain as it is could you please let me know the technical barriers
you are facing for this.
	
-Suraj
-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7212131
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suraj Batuwana <sb...@virtusa.com>.
Hi Suresh,
I was able to extract the issue from my application. Only thing you need to
do is run the sql file(createDB.sql) with the attachement and try to run the
following select statement
Select * from vwDerbyBasePackage_derbygen_DerbyRepositoryObject67ceb178

I have also attached some batch files which can help to run the sql and
select statement, which u can save some time :)
1. Extract the given zip file to hard drive.
2. Edit 2 java class dbPath values and give a valid location in your hard
drive.
3. Start cloudscape
4. Compile the attached java classes
5. Run CreateDatabase.bat
6. Run TestIssue.bat

Please let me know if you can recreate and identify the issue.

Regards,
Suraj




Suresh Thalamati wrote:
> 
> Hi Suraj,
> 
> In my last e-mail , i mentioned ; error may be due to file descriptot 
> leaks.  Did you get chance to find if that is the case ?
> 
> I assume you are running on Windows , long time ago I used filemon to
> track some leak. But it is very tedious work, filemon program
> can help you track files opened by a process.
> 
> http://www.microsoft.com/technet/sysinternals/processesandthreads/processmonitor.mspx
> http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx
> --
> 
> If you can provide stand alone reproduction with Derby, then it will 
> be possible to debug. Otherwise I am just shooting theories in dark,
> I know it is hard.
> 
> Are you seeing this error if you use derby in plain embedded mode not 
> as networdk server embedded ?
> 
> One another thing I would double check is if the security policy files 
> have right permissions for derby ? if you are running with security 
> manager enabled.
> 
> 
> Thanks
> -suresh
> 
> Suraj Batuwana wrote:
>> Also in client side i am getting the folloing error
>> 
>> Error when executing
>> query:com.ibm.websphere.ce.cm.StaleConnectionException:
>> Meta-data for Container
>> org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could not be
>> accessed
>> junit.framework.AssertionFailedError: Error when executing
>> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>> Container org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d
>> could
>> not be accessed
>> 
>> 
>> 
>> 
>> Suraj Batuwana wrote:
>> 
>>>Hi ,
>>>Thanx for the answer. I have used the Embbeded network server as you have
>>>told. But now when i am running junit test cases
>>>in the nightly build i am getting folloing client side errors in my test
>>>classes
>>>
>>>Error when executing
>>>query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>>>Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639
could
>>>not be accessed
>>>junit.framework.AssertionFailedError: Error when executing
>>>query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>>>Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639
could
>>>not be accessed
>>>
>>>also I have attached the derby.log for your reference.
>>>Note: I have used IBM JDK 1.4.2 and cloudscape 10.2.1.6 with Websphere
>>>6.0.2.5
>>>
>>>Also in my seg0(E:\Cloud_Branch\TestDB\seg0\) folder there were 3854 dat
>>>files were there.
>>>
>>>why does it says as
>>>	RAFContainer@32d20639 could not be accessed ?
>>>
>>>-Suraj
>>>
>>>Suraj Batuwana wrote:
>>>
>>>>I am not sure I got what you tring to say. 
>>>>
>>>>What is  embedded network server ? 
>>>>        When I am creating the datasource in Websphere I have used the 
>>>>        
>>>>         implementing class as    
>>>>"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 
>>>>         implementing class for XA as    
>>>>"org.apache.derby.jdbc.EmbeddedXADataSource" 
>>>>         dataSource helper class as
>>>>"com.ibm.websphere.rsadapter.DerbyDataStoreHelper" 
>>>>          
>>>>         and add derby.jar,derbynet.jar and derbytools.jar to the class
>>>>path.             
>>>>
>>>>
>>>>
>>>> "client application could use the client driver" 
>>>>        Is this means to use the org.apache.derby.jdbc.ClientDriver ?,
>>>>but it is a Derby Network Client driver. At the moment 
>>>>I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver. 
>>>>
>>>>-Suraj 
>>>>
>>>>
>>>>Daniel John Debrunner-2 wrote:
>>>>
>>>>>Suraj Batuwana wrote:
>>>>>
>>>>>>Hi All,
>>>>>>	I am a derby user but for my application I need some improved version
>>>>>>of
>>>>>>Derby. 
>>>>>>	So I thought of writing to this group.
>>>>>>	
>>>>>>	For my application I need to access a single Derby database(using
>>>>>>Embedded
>>>>>>mode) from 
>>>>>>		1. Data source( In a Websphere 6.0.2.5)
>>>>>>		2. Client application
>>>>>>		
>>>>>>	But when try to access the database it will throw exceptions like
>>>>>>"Caused
>>>>>>by: java.sql.SQLException: Failed to start database
>>>>>>'E:\source\database\TestDB'" from a one of the place.
>>>>>>	
>>>>>>	I know this happens because Embedded, a Derby database can be booted
>>>>>>only
>>>>>>from a single JVM, In my case ,	it is trying to boot from 2
JVMs(client
>>>>>>JVM
>>>>>>and server JVM), but when I used the Network mode there is no such an
>>>>>>issue.Is there a way future Derby (Embedded mode) version can handle
>>>>>>the
>>>>>>above issue or It will remain as it is ?
>>>>>
>>>>>You can mix embedded and the network server, so in your case the 
>>>>>WebSphere could be running embedded with an embedded network server. 
>>>>>Then the client application could use the client driver.
>>>>>
>>>>>Dan.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> http://www.nabble.com/file/4136/derby.log derby.log 
>>>
>> 
>> 
> 
> 
> 
http://www.nabble.com/file/4227/DerbyIssue.zip DerbyIssue.zip 
-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7465541
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suresh Thalamati <su...@gmail.com>.
Hi Suraj,

In my last e-mail , i mentioned ; error may be due to file descriptot 
leaks.  Did you get chance to find if that is the case ?

I assume you are running on Windows , long time ago I used filemon to
track some leak. But it is very tedious work, filemon program
can help you track files opened by a process.

http://www.microsoft.com/technet/sysinternals/processesandthreads/processmonitor.mspx
http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx
--

If you can provide stand alone reproduction with Derby, then it will 
be possible to debug. Otherwise I am just shooting theories in dark,
I know it is hard.

Are you seeing this error if you use derby in plain embedded mode not 
as networdk server embedded ?

One another thing I would double check is if the security policy files 
have right permissions for derby ? if you are running with security 
manager enabled.


Thanks
-suresh

Suraj Batuwana wrote:
> Also in client side i am getting the folloing error
> 
> Error when executing query:com.ibm.websphere.ce.cm.StaleConnectionException:
> Meta-data for Container
> org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could not be
> accessed
> junit.framework.AssertionFailedError: Error when executing
> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
> Container org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could
> not be accessed
> 
> 
> 
> 
> Suraj Batuwana wrote:
> 
>>Hi ,
>>Thanx for the answer. I have used the Embbeded network server as you have
>>told. But now when i am running junit test cases
>>in the nightly build i am getting folloing client side errors in my test
>>classes
>>
>>Error when executing
>>query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>>Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could
>>not be accessed
>>junit.framework.AssertionFailedError: Error when executing
>>query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>>Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could
>>not be accessed
>>
>>also I have attached the derby.log for your reference.
>>Note: I have used IBM JDK 1.4.2 and cloudscape 10.2.1.6 with Websphere
>>6.0.2.5
>>
>>Also in my seg0(E:\Cloud_Branch\TestDB\seg0\) folder there were 3854 dat
>>files were there.
>>
>>why does it says as
>>	RAFContainer@32d20639 could not be accessed ?
>>
>>-Suraj
>>
>>Suraj Batuwana wrote:
>>
>>>I am not sure I got what you tring to say. 
>>>
>>>What is  embedded network server ? 
>>>        When I am creating the datasource in Websphere I have used the 
>>>        
>>>         implementing class as    
>>>"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 
>>>         implementing class for XA as    
>>>"org.apache.derby.jdbc.EmbeddedXADataSource" 
>>>         dataSource helper class as
>>>"com.ibm.websphere.rsadapter.DerbyDataStoreHelper" 
>>>          
>>>         and add derby.jar,derbynet.jar and derbytools.jar to the class
>>>path.             
>>>
>>>
>>>
>>> "client application could use the client driver" 
>>>        Is this means to use the org.apache.derby.jdbc.ClientDriver ?,
>>>but it is a Derby Network Client driver. At the moment 
>>>I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver. 
>>>
>>>-Suraj 
>>>
>>>
>>>Daniel John Debrunner-2 wrote:
>>>
>>>>Suraj Batuwana wrote:
>>>>
>>>>>Hi All,
>>>>>	I am a derby user but for my application I need some improved version
>>>>>of
>>>>>Derby. 
>>>>>	So I thought of writing to this group.
>>>>>	
>>>>>	For my application I need to access a single Derby database(using
>>>>>Embedded
>>>>>mode) from 
>>>>>		1. Data source( In a Websphere 6.0.2.5)
>>>>>		2. Client application
>>>>>		
>>>>>	But when try to access the database it will throw exceptions like
>>>>>"Caused
>>>>>by: java.sql.SQLException: Failed to start database
>>>>>'E:\source\database\TestDB'" from a one of the place.
>>>>>	
>>>>>	I know this happens because Embedded, a Derby database can be booted
>>>>>only
>>>>>from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client
>>>>>JVM
>>>>>and server JVM), but when I used the Network mode there is no such an
>>>>>issue.Is there a way future Derby (Embedded mode) version can handle
>>>>>the
>>>>>above issue or It will remain as it is ?
>>>>
>>>>You can mix embedded and the network server, so in your case the 
>>>>WebSphere could be running embedded with an embedded network server. 
>>>>Then the client application could use the client driver.
>>>>
>>>>Dan.
>>>>
>>>>
>>>>
>>>
>>>
>> http://www.nabble.com/file/4136/derby.log derby.log 
>>
> 
> 


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Stanley Bradbury <St...@gmail.com>.
Jean T. Anderson wrote:
> Suraj Batuwana wrote:
>   
>> Also in client side i am getting the folloing error
>>
>> Error when executing query:com.ibm.websphere.ce.cm.StaleConnectionException:
>> Meta-data for Container
>> org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could not be
>> accessed
>> junit.framework.AssertionFailedError: Error when executing
>> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
>> Container org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could
>> not be accessed
>>     
>
> I'm going out on a limb here because I know nothing about websphere, but
> I wonder if that "container ... could not be accessed" error has
> anything to do with file permissions on the data files that make up the
> derby database?
>
> Can you access that database using ij? If you're unfamiliar with ij, a
> quick intro is at
> http://db.apache.org/derby/papers/DerbyTut/ij_intro.html  and example
> using the client jdbc driver in ij is at
> http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#ij_ns_client .
>
>  -jean
>
>   
Based on this method near the top of the  stack trace 
(java.security.AccessController.doPrivileged1) it does look like this is 
a security problem.  I believe that RAFContainer@32d20639  refers to 
data file that Derby is attempting to open.  Here are some ideas (some 
more far fetched than others):
- Derby-1761: recent releases of IBM JVM v1.4.2 had a bug that produced 
access failures because property permissions were not being passed to 
methods being called.
- Make sure this is local disk, not a share or network mount of some 
sort: E:\Cloud_Branch\TestDB\seg0\
- Make sure no other thread/process (e.g. copy/backup, compression, 
etc.) has the file locked.
- Check the file size - I have seen XSDG3 errors when trying to open a 
corrupted database containing zero length DAT files.
    -HTH
XSDG3: Meta-data for Container 
org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could not be 
accessed at 
org.apache.derby.iapi.error.StandardException.newException(Unknown 
Source) at org.apache.derby.impl.store.raw.data.RAFContainer.run(Unknown 
Source) at java.security.AccessController.doPrivileged1(Native Method) 
at 
java.security.AccessController.doPrivileged(AccessController.java(Compiled 
Code)) at org.apache.derby.impl.store.raw.data.RAFContainer.openContainer


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Suraj Batuwana wrote:
> Also in client side i am getting the folloing error
> 
> Error when executing query:com.ibm.websphere.ce.cm.StaleConnectionException:
> Meta-data for Container
> org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could not be
> accessed
> junit.framework.AssertionFailedError: Error when executing
> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
> Container org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could
> not be accessed

I'm going out on a limb here because I know nothing about websphere, but
I wonder if that "container ... could not be accessed" error has
anything to do with file permissions on the data files that make up the
derby database?

Can you access that database using ij? If you're unfamiliar with ij, a
quick intro is at
http://db.apache.org/derby/papers/DerbyTut/ij_intro.html  and example
using the client jdbc driver in ij is at
http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#ij_ns_client .

 -jean

Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suraj Batuwana <sb...@virtusa.com>.
Also in client side i am getting the folloing error

Error when executing query:com.ibm.websphere.ce.cm.StaleConnectionException:
Meta-data for Container
org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could not be
accessed
junit.framework.AssertionFailedError: Error when executing
query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
Container org.apache.derby.impl.store.raw.data.RAFContainer@1eafc73d could
not be accessed




Suraj Batuwana wrote:
> 
> Hi ,
> Thanx for the answer. I have used the Embbeded network server as you have
> told. But now when i am running junit test cases
> in the nightly build i am getting folloing client side errors in my test
> classes
> 
> Error when executing
> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
> Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could
> not be accessed
> junit.framework.AssertionFailedError: Error when executing
> query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
> Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could
> not be accessed
> 
> also I have attached the derby.log for your reference.
> Note: I have used IBM JDK 1.4.2 and cloudscape 10.2.1.6 with Websphere
> 6.0.2.5
> 
> Also in my seg0(E:\Cloud_Branch\TestDB\seg0\) folder there were 3854 dat
> files were there.
> 
> why does it says as
> 	RAFContainer@32d20639 could not be accessed ?
> 
> -Suraj
> 
> Suraj Batuwana wrote:
>> 
>> I am not sure I got what you tring to say. 
>> 
>> What is  embedded network server ? 
>>         When I am creating the datasource in Websphere I have used the 
>>         
>>          implementing class as    
>> "org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 
>>          implementing class for XA as    
>> "org.apache.derby.jdbc.EmbeddedXADataSource" 
>>          dataSource helper class as
>> "com.ibm.websphere.rsadapter.DerbyDataStoreHelper" 
>>           
>>          and add derby.jar,derbynet.jar and derbytools.jar to the class
>> path.             
>> 
>> 
>> 
>>  "client application could use the client driver" 
>>         Is this means to use the org.apache.derby.jdbc.ClientDriver ?,
>> but it is a Derby Network Client driver. At the moment 
>> I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver. 
>> 
>> -Suraj 
>> 
>> 
>> Daniel John Debrunner-2 wrote:
>>> 
>>> Suraj Batuwana wrote:
>>>> Hi All,
>>>> 	I am a derby user but for my application I need some improved version
>>>> of
>>>> Derby. 
>>>> 	So I thought of writing to this group.
>>>> 	
>>>> 	For my application I need to access a single Derby database(using
>>>> Embedded
>>>> mode) from 
>>>> 		1. Data source( In a Websphere 6.0.2.5)
>>>> 		2. Client application
>>>> 		
>>>> 	But when try to access the database it will throw exceptions like
>>>> "Caused
>>>> by: java.sql.SQLException: Failed to start database
>>>> 'E:\source\database\TestDB'" from a one of the place.
>>>> 	
>>>> 	I know this happens because Embedded, a Derby database can be booted
>>>> only
>>>> from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client
>>>> JVM
>>>> and server JVM), but when I used the Network mode there is no such an
>>>> issue.Is there a way future Derby (Embedded mode) version can handle
>>>> the
>>>> above issue or It will remain as it is ?
>>> 
>>> You can mix embedded and the network server, so in your case the 
>>> WebSphere could be running embedded with an embedded network server. 
>>> Then the client application could use the client driver.
>>> 
>>> Dan.
>>> 
>>> 
>>> 
>> 
>> 
>  http://www.nabble.com/file/4136/derby.log derby.log 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7334815
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suraj Batuwana <sb...@virtusa.com>.
Hi ,
Thanx for the answer. I have used the Embbeded network server as you have
told. But now when i am running junit test cases
in the nightly build i am getting folloing client side errors in my test
classes

Error when executing query:com.ibm.websphere.ce.cm.StaleConnectionException:
Meta-data for Container
org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could not be
accessed
junit.framework.AssertionFailedError: Error when executing
query:com.ibm.websphere.ce.cm.StaleConnectionException: Meta-data for
Container org.apache.derby.impl.store.raw.data.RAFContainer@32d20639 could
not be accessed

also I have attached the derby.log for your reference.
Note: I have used IBM JDK 1.4.2 and cloudscape 10.2.1.6 with Websphere
6.0.2.5

Also in my seg0(E:\Cloud_Branch\TestDB\seg0\) folder there were 3854 dat
files were there.

why does it says as
	RAFContainer@32d20639 could not be accessed ?

-Suraj

Suraj Batuwana wrote:
> 
> I am not sure I got what you tring to say. 
> 
> What is  embedded network server ? 
>         When I am creating the datasource in Websphere I have used the 
>         
>          implementing class as    
> "org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 
>          implementing class for XA as    
> "org.apache.derby.jdbc.EmbeddedXADataSource" 
>          dataSource helper class as
> "com.ibm.websphere.rsadapter.DerbyDataStoreHelper" 
>           
>          and add derby.jar,derbynet.jar and derbytools.jar to the class
> path.             
> 
> 
> 
>  "client application could use the client driver" 
>         Is this means to use the org.apache.derby.jdbc.ClientDriver ?, but
> it is a Derby Network Client driver. At the moment 
> I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver. 
> 
> -Suraj 
> 
> 
> Daniel John Debrunner-2 wrote:
>> 
>> Suraj Batuwana wrote:
>>> Hi All,
>>> 	I am a derby user but for my application I need some improved version
>>> of
>>> Derby. 
>>> 	So I thought of writing to this group.
>>> 	
>>> 	For my application I need to access a single Derby database(using
>>> Embedded
>>> mode) from 
>>> 		1. Data source( In a Websphere 6.0.2.5)
>>> 		2. Client application
>>> 		
>>> 	But when try to access the database it will throw exceptions like
>>> "Caused
>>> by: java.sql.SQLException: Failed to start database
>>> 'E:\source\database\TestDB'" from a one of the place.
>>> 	
>>> 	I know this happens because Embedded, a Derby database can be booted
>>> only
>>> from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client
>>> JVM
>>> and server JVM), but when I used the Network mode there is no such an
>>> issue.Is there a way future Derby (Embedded mode) version can handle the
>>> above issue or It will remain as it is ?
>> 
>> You can mix embedded and the network server, so in your case the 
>> WebSphere could be running embedded with an embedded network server. 
>> Then the client application could use the client driver.
>> 
>> Dan.
>> 
>> 
>> 
> 
> 
http://www.nabble.com/file/4136/derby.log derby.log 
-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7315062
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suraj Batuwana <sb...@virtusa.com>.
I am not sure I got what you tring to say. 

What is  embedded network server ? 
        When I am creating the datasource in Websphere I have used the 
        
         implementing class as    
"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 
         implementing class for XA as    
"org.apache.derby.jdbc.EmbeddedXADataSource" 
         dataSource helper class as
"com.ibm.websphere.rsadapter.DerbyDataStoreHelper" 
          
         and add derby.jar,derbynet.jar and derbytools.jar to the class
path.             



 "client application could use the client driver" 
        Is this means to use the org.apache.derby.jdbc.ClientDriver ?, but
it is a Derby Network Client driver. At the moment 
I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver. 

-Suraj 


Daniel John Debrunner-2 wrote:
> 
> Suraj Batuwana wrote:
>> Hi All,
>> 	I am a derby user but for my application I need some improved version of
>> Derby. 
>> 	So I thought of writing to this group.
>> 	
>> 	For my application I need to access a single Derby database(using
>> Embedded
>> mode) from 
>> 		1. Data source( In a Websphere 6.0.2.5)
>> 		2. Client application
>> 		
>> 	But when try to access the database it will throw exceptions like
>> "Caused
>> by: java.sql.SQLException: Failed to start database
>> 'E:\source\database\TestDB'" from a one of the place.
>> 	
>> 	I know this happens because Embedded, a Derby database can be booted
>> only
>> from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client
>> JVM
>> and server JVM), but when I used the Network mode there is no such an
>> issue.Is there a way future Derby (Embedded mode) version can handle the
>> above issue or It will remain as it is ?
> 
> You can mix embedded and the network server, so in your case the 
> WebSphere could be running embedded with an embedded network server. 
> Then the client application could use the client driver.
> 
> Dan.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7213870
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Daniel John Debrunner <dj...@apache.org>.
Suraj Batuwana wrote:
> Hi All,
> 	I am a derby user but for my application I need some improved version of
> Derby. 
> 	So I thought of writing to this group.
> 	
> 	For my application I need to access a single Derby database(using Embedded
> mode) from 
> 		1. Data source( In a Websphere 6.0.2.5)
> 		2. Client application
> 		
> 	But when try to access the database it will throw exceptions like "Caused
> by: java.sql.SQLException: Failed to start database
> 'E:\source\database\TestDB'" from a one of the place.
> 	
> 	I know this happens because Embedded, a Derby database can be booted only
> from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client JVM
> and server JVM), but when I used the Network mode there is no such an
> issue.Is there a way future Derby (Embedded mode) version can handle the
> above issue or It will remain as it is ?

You can mix embedded and the network server, so in your case the 
WebSphere could be running embedded with an embedded network server. 
Then the client application could use the client driver.

Dan.


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Daniel John Debrunner wrote:
> Suraj Batuwana wrote:
> 
>> I am not sure I got what you tring to say.
>>
>> What is  embedded network server ?
> 
> It's the network server for Derby running within the same JVM as your
> application, in this case WebSphere. Then your application continues to
> use the embedded driver to connect to Derby, while any other application
> running outside the JVM can use the Derby network client to connect to
> the Derby engine running in WebSphere via the network server.

< deleted Dan's good resources >

Also there's a short writeup on the online tutorial here:

http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#Embedded+Server

 -jean


Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Daniel John Debrunner <dj...@apache.org>.
Suraj Batuwana wrote:
> I am not sure I got what you tring to say.
> 
> What is  embedded network server ?

It's the network server for Derby running within the same JVM as your 
application, in this case WebSphere. Then your application continues to 
use the embedded driver to connect to Derby, while any other application 
running outside the JVM can use the Derby network client to connect to 
the Derby engine running in WebSphere via the network server.

Look at this presentation:
http://db.apache.org/derby/binaries/djd_derby_intro.pdf

Slides 47-54 show the network server and running it as an embedded server.

Slide 59 shows the network server embedded in an application server 
which is what I'm suggesting for you.

For details on how to start the network server look here:

http://db.apache.org/derby/docs/10.2/adminguide/tadminconfig814963.html

Dan.



Re: Can't the embedded mode of a Derby database boot from a dual JVMs

Posted by Suraj Batuwana <sb...@virtusa.com>.
I am not sure I got what you tring to say.

What is  embedded network server ?
	When I am creating the datasource in Websphere I have used the 
	
	 implementing class as    
"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"	
	 implementing class for XA as    
"org.apache.derby.jdbc.EmbeddedXADataSource"
	 dataSource helper class as
"com.ibm.websphere.rsadapter.DerbyDataStoreHelper"
	 
	 and add derby.jar,derbynet.jar and derbytools.jar to the class path.	            	



 "client application could use the client driver"
	Is this means to use the org.apache.derby.jdbc.ClientDriver ?, but it is a
Derby Network Client driver. At the moment
I am using org.apache.derby.jdbc.EmbeddedDriver as my client driver.

-Suraj

Suraj Batuwana wrote:
> 
> Hi All,
> 	I am a derby user but for my application I need some improved version of
> Derby. 
> 	So I thought of writing to this group.
> 	
> 	For my application I need to access a single Derby database(using
> Embedded mode) from 
> 		1. Data source( In a Websphere 6.0.2.5)
> 		2. Client application
> 		
> 	But when try to access the database it will throw exceptions like "Caused
> by: java.sql.SQLException: Failed to start database
> 'E:\source\database\TestDB'" from a one of the place.
> 	
> 	I know this happens because Embedded, a Derby database can be booted only
> from a single JVM, In my case ,	it is trying to boot from 2 JVMs(client
> JVM and server JVM), but when I used the Network mode there is no such an
> issue.Is there a way future Derby (Embedded mode) version can handle the
> above issue or It will remain as it is ?
> 
> Please, this is very important for the progress of my application. 
> 	
> If it is remain as it is could you please let me know the technical
> barriers you are facing for this.
> 	
> -Suraj
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-tf2586621.html#a7212824
Sent from the Apache Derby Developers mailing list archive at Nabble.com.