Re: Multiple Derby embedded engine instances - problem
Hi Bob, It sounds like you need a better inter-process communication technique than relying on Derby's database lock file (db.lck). Maybe someone on this list can recommend a good resource for you to consult. Glad to hear that your applications are playing nicely now. -Rick On 7/24/19 10:16 PM, Bob M wrote: Hi Rick Today I employed a delay in programs 2, 3,4, & 5 on both PCs [5 sec, 10sec, 15sec, & 20sec] So Program 1 on both machines which uses currency-pair EURCAD start immediately on the hour and hopefully finishes before 5 secs is up Then Program 2 on both machines kicks off etc. So far, I have had no errors involving missing drivers etc. In addition, I get a new record added to each database each hour My problem was a timing issue involving instances of derby opening while another instance was already opened I don't know how to better my 'work-around' Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
Hi Rick Today I employed a delay in programs 2, 3,4, & 5 on both PCs [5 sec, 10sec, 15sec, & 20sec] So Program 1 on both machines which uses currency-pair EURCAD start immediately on the hour and hopefully finishes before 5 secs is up Then Program 2 on both machines kicks off etc. So far, I have had no errors involving missing drivers etc. In addition, I get a new record added to each database each hour My problem was a timing issue involving instances of derby opening while another instance was already opened I don't know how to better my 'work-around' Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
The missing driver problem is almost certainly a classpath issue. What are the classpaths for your applications? On 7/23/19 7:23 PM, Bob M wrote: Hi Rick No - each program references a unique database (i.e. I have 5 different databases) My problem seems to be that 1) the first instance of derby is kicked off 2) while it is operating a second instance is kicked off - and it is here that the execution falters - either not finding a suitable driver or something else which I can't put my finger on Here is a clue :- When I use windows explorer to look at the derby.log it states that the file has been updated by another program - do I wish to update it - If I say yes - the details in the log alter - i.e. a different currency-pair coming from the second program is referenced Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
Hi Rick No - each program references a unique database (i.e. I have 5 different databases) My problem seems to be that 1) the first instance of derby is kicked off 2) while it is operating a second instance is kicked off - and it is here that the execution falters - either not finding a suitable driver or something else which I can't put my finger on Here is a clue :- When I use windows explorer to look at the derby.log it states that the file has been updated by another program - do I wish to update it - If I say yes - the details in the log alter - i.e. a different currency-pair coming from the second program is referenced Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
I'm not sure what the nature of your problem is. Dual-booting a database is a bad idea. See http://db.apache.org/derby/docs/10.15/devguide/cdevdvlp20458.html. Are multiple programs able to boot the same database simultaneously? On 7/23/19 4:52 PM, Bob M wrote: Hi Rick and Bryan My problem still persists :( I am trying to access Apache derby more than once at the same time Is it possible to make more than one copy of derby and uniquely assign each copy to a different program ? Alternatively is it possible to add an inhibit which prevents a new task starting until the previous task is finished? I can see a need here for a basic scheduler Any thoughts / suggestions ? Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
Hi Rick and Bryan My problem still persists :( I am trying to access Apache derby more than once at the same time Is it possible to make more than one copy of derby and uniquely assign each copy to a different program ? Alternatively is it possible to add an inhibit which prevents a new task starting until the previous task is finished? I can see a need here for a basic scheduler Any thoughts / suggestions ? Bob M -- Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Re: Multiple Derby embedded engine instances - problem
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
Re: Multiple Derby embedded engine instances - problem
Yes, but not PATH, CLASSPATH. They are different environment variables. On Fri, Jul 12, 2019 at 9:06 PM Bob M 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
Re: Multiple Derby embedded engine instances - problem
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
Re: Multiple Derby embedded engine instances - problem
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.0 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
Re: Multiple Derby embedded engine instances - problem
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 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
Re: Multiple Derby embedded engine instances - problem
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
Re: Multiple Derby embedded engine instances - problem
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
Re: Multiple Derby embedded engine instances - problem
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", ""); 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-09500118 on database directory C:\Users\\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-0b206fe8 on database directory C:\Users\b\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
Re: Multiple Derby embedded engine instances - problem
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
Re: Multiple Derby embedded engine instances - problem
Thanks Rick I have :- props.put("user", "xxx"); props.put("password", ""); 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-09500118 on database directory C:\Users\\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-0b206fe8 on database directory C:\Users\b\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
Re: Multiple Derby embedded engine instances - problem
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