Multiple Derby embedded engine instances - problem

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Derby embedded engine instances - problem

Bob M
Hi
I run several java programs at the same time on the same PC - once started
they action on the hour
Each program references a separate sql database - which it hopefully
connects to and updates some records

I have 2 intermitant issues:-

1) "can't find a driver" error on 1 or more of the programs
I have a separate copy of the driver in a different folder for each program

2) an undisclosed error (i.e. no error message) but the connection is NOT
made and nothing is updated

Please can somebody suggest where I might look to sort out these two
problems ?

Bob M



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Rick Hillegas-3
On 7/11/19 10:15 PM, Bob M wrote:

> Hi
> I run several java programs at the same time on the same PC - once started
> they action on the hour
> Each program references a separate sql database - which it hopefully
> connects to and updates some records
>
> I have 2 intermitant issues:-
>
> 1) "can't find a driver" error on 1 or more of the programs
> I have a separate copy of the driver in a different folder for each program
>
> 2) an undisclosed error (i.e. no error message) but the connection is NOT
> made and nothing is updated
>
> Please can somebody suggest where I might look to sort out these two
> problems ?
>
> Bob M
>
>
>
> --
> Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
>
Each application should have a diagnostic log called derby.log, located
in the app's current directory. To make sure that the log has maximal
information, I recommend that you boot the application with the
following JVM switches:

   -Dderby.language.logStatementText=true
-Dderby.stream.error.logSeverityLevel=0

Hope this helps,

-Rick

Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
Thanks Rick

I have :-

props.put("user", "xxx");
props.put("password", "zzzz");

so do I add a couple of further props.put statements ?

I seem to have just one log file - here is an example where 2 of 5 different
databases are mentioned ???
(I am running 5 different programs at the same time)

----------------------------------------------------------------
Fri Jul 12 00:00:02 UTC 2019:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.11.1.1 - (1616546): instance a816c00e-016b-e37a-c68c-000009500118
on database directory C:\Users\aaaa\Databases\us_copiosus_NZDUSD_1010 with
class loader com.dukascopy.dds2.greed.agent.a.c@651fbc34
Loaded from http://www.dukascopy.com/JFOREX
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_152-b16
user.dir=C:\Users\64210\JForex
os.name=Windows 10
os.arch=amd64
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
Fri Jul 12 00:00:08 UTC 2019: Shutting down Derby engine
----------------------------------------------------------------
Fri Jul 12 00:00:08 UTC 2019:
Shutting down instance a816c00e-016b-e37a-c4d7-00000b206fe8 on database
directory C:\Users\bbbbb\Databases\us_copiosus_EURCAD_1010 with class loader
com.dukascopy.dds2.greed.agent.a.c@31499e31
----------------------------------------------------------------

Bob M





--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
This post was updated on .
Hi Rick

added the two properties as suggested

the result was dramatic !

in each program I write several lines to a file

this file contains only the first of many lines that should have been
outputed - then nothing

what do I do now ?

Bob M

oh - and I can't find any derby log file !

--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Rick Hillegas-3
In reply to this post by Bob M
I don't know what that properties object represents. It looks like it is configuring the attributes of a Derby connection. What you want to do is something else. You want to configure the system properties which are used for all embedded Derby databases used by your application. One way to do this is to create a file called derby.properties and place that file in the current directory of your application. From the attached derby.log, it looks like that directory is C:\Users\64210\JForex. The contents of your derby.properties would be

derby.language.logStatementText=true
derby.stream.error.logSeverityLevel=0

Alternatively, if you boot the application by running the java command then you could boot the application like this:

  java -Dderby.language.logStatementText=true -Dderby.stream.error.logSeverityLevel=0 ...

Hope this helps,
-Rick

On 7/12/19 8:53 AM, Bob M wrote:
Thanks Rick

I have :-

props.put("user", "xxx");
props.put("password", "zzzz");

so do I add a couple of further props.put statements ?

I seem to have just one log file - here is an example where 2 of 5 different
databases are mentioned ???
(I am running 5 different programs at the same time)

----------------------------------------------------------------
Fri Jul 12 00:00:02 UTC 2019:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.11.1.1 - (1616546): instance a816c00e-016b-e37a-c68c-000009500118 
on database directory C:\Users\aaaa\Databases\us_copiosus_NZDUSD_1010 with
class loader com.dukascopy.dds2.greed.agent.a.c@651fbc34 
Loaded from http://www.dukascopy.com/JFOREX
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_152-b16
user.dir=C:\Users\64210\JForex
os.name=Windows 10
os.arch=amd64
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
Fri Jul 12 00:00:08 UTC 2019: Shutting down Derby engine
----------------------------------------------------------------
Fri Jul 12 00:00:08 UTC 2019:
Shutting down instance a816c00e-016b-e37a-c4d7-00000b206fe8 on database
directory C:\Users\bbbbb\Databases\us_copiosus_EURCAD_1010 with class loader
com.dukascopy.dds2.greed.agent.a.c@31499e31 
----------------------------------------------------------------

Bob M





--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html


Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Rick Hillegas-3
In reply to this post by Bob M
Do you see any errors in derby.log? Can you attach it (after scrubbing
out any sensitive information)?

On 7/12/19 3:14 PM, Bob M wrote:

> Hi Rick
>
> added the two properties as suggested
>
> the result was dramatic !
>
> in each program I write several lines to a file
>
> this file contains only the first of many lines that should have been
> outputed - then nothing
>
> what do I do now ?
>
> Bob M
>
>
>
> --
> Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
>

Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
This post was updated on .
Hi Rick

Ignore the above message... I see I had two 'on the hour' attempts before
the market closes for the weekend

On the first of these hours (after I added the 2 new properties)

In the logfile I use, I got the following message for each of the 5
different programs running simultaneously

Unable to load the JDBC driver org.apache.derby.jdbc.Embedded Driver
Please check your ClASSPATH

and the derby log file was as shown above

On the second hour

my log file showed only the first line and no derby log file can be found

Bob M



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bryan Pendleton-3
The EmbeddedDriver is located in the derby.jar jar file, which MUST be
on the CLASSPATH of your program.

bryan

On Fri, Jul 12, 2019 at 3:52 PM Bob M <[hidden email]> wrote:

>
> Hi Rick
>
> Ignore the above message... I see I had two 'on the hour' attempts before
> the market closes for the weekend
>
> On the first of these hours (after I added the 2 new properties)
>
> In the logfile I use, I got the following message for each of the 5
> different programs running simultaneously
>
> Unable to load the JDBC driver org.apache.derby.jdbc.Embedded Driver
> Please check your ClASSPATH
>
> and the derby log file was as shown abve
>
> On the second hour
>
> my log file showed only the first line and no derby log file can be found
>
> Bob M
>
>
>
> --
> Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
This post was updated on .
In reply to this post by Bob M
Hi Rick

I have had a good look around my C drive at "derby" files

I see the latest version of derby I installed was 10.14.2.0
However, the log example I sent you (above) talks about version 10.11.1.1

I also seem to have various length derby.jar files [my bad]

I have now ensured that all copies of derby.jar come from version 10.14.2.0

On Monday I shall see what occurs :)
Bob M
New Zealand



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
This post was updated on .
In reply to this post by Bryan Pendleton-3
Bryan

Environment Variables
System Variables

variable = DERBY_INSTALL
value = C:\Apache\db-derby-10.14.1.0-bin

variable = Path
value = %DERBY_INSTALL%\lib\derby.jar

Is that what you are meaning?

Bob M



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bryan Pendleton-3
Yes, but not PATH, CLASSPATH. They are different environment variables.

On Fri, Jul 12, 2019 at 9:06 PM Bob M <[hidden email]> wrote:

>
> Bryan
>
> Environment Variables
> System Variables
> variable = Path
> value = %DERBY_INSTALL%\lib\derby.jar
>
> Is that what you are meaning?
>
> Bob M
>
>
>
> --
> Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Derby embedded engine instances - problem

Bob M
Hi Rick and Bryan

Many, many thanks for all your good advice
Off to a very good start today...........
My problem seems to have been a mismatch of derby.jar versions

And now, I know how to setup the derby.properties file and where to put it
:)

Thanks again - a great forum

Bob M
Dunedin
New Zealand



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html