Test for active datasource

I have a group of users who are going to be using laptops, they will receive jobs from a server and when complete upload their results back to the server. For a significant period of time they will be off-line.

  1. Is there a way to test to see if a datasource is valid without poping up an error. I have tried using a try/catch to stop the error without success. It seems if Servoy is expecting a datasource and it fails it throws up an error.

ie if datasource valid got to layout A else layout B and dont throw an error!

  1. I have also tried to use the dataswitcher to do the test again this simply hangs if there is no connection.

I am sure there is an obvious solution to this if anyone has any ideas I would be very grateful!!

cheers
Gordon

I will make a feature request for this. So you want something like:

databasemanager.isServerActive(“string”)

jcompagner:
I will make a feature request for this. So you want something like:

databasemanager.isServerActive(“string”)

We have an interim fix that polls the server using a Java call, however by adding this you will open Servoy up to a whole new market of laptop based remote users who occasionally login. I would suggest this and the data switcher tag would be a very powerful way to sync data that the vast majority of developers could utilise.

rgds
Gordon

But the laptops are connected to the repository server?
They only miss a connection to a special data server?

But the laptops are connected to the repository server?
They only miss a connection to a special data server?

jcompagner:
But the laptops are connected to the repository server?
They only miss a connection to a special data server?

The laptops will have a cut down developer running their own Repository - we have a sort of demo that we can show you. Please contact me via AIM to discuss if possible

jcompagner:
I will make a feature request for this. So you want
something like:

databasemanager.isServerActive(“string”)

This would be very interesting. Specially if one could set the Active Server, like:

var bol = databasemanager.isServerActive(“serverName”);

if (bol != true) {
var ok = databasemanager.setActiveServer(“serverName”); // returns boolean
// make sure server is set or exit gracefully
}
else {
// option to synchronize or do it autommaticaly
// go on server already set…
}

Must I say more…
best,
Miguel

I’ve been working with Gordon on this and that is pretty much exactly what we have implemented.

We’ve used Java and essentially open a TCP socket to the remote MySQL server to see if it is present and that we can connect to it. If it is we use the “databasemanager.switchServer()” method to change the datasource throughout the solution.

Once the nuts & bolts are done, you have to deal with syncing the data. We have kept it simple and essentially are only syncing one way (from client to server), but with a bit of effort there is no reason why something more complex could be achieved.

It would be better to have something within Servoy rather than having to rely on custom Java code within the solution, but for now at least it is a workable solution.

Lee.
Servoy Hosting @ Shouri
__*http://www.shouri.com/*__

leemcneil:
…We have kept it simple and essentially are only syncing one way (from client to server), …

The way I see it remote users would not, in most applications, carry the Server bagage with them. That is, the majority of applications have some important biz-rules about record modification and/or are just to big or critical) - they are just not Outlook.

So it makes sense that they have a local db (something like Firebird, SQLite, whatever) with a limited amount of records (some foundset or even no records) and that on connection first update the server with their new records, then work as a normal Servoy client. So just client->server update makes sense to me.

leemcneil:

It would be better to have something within Servoy rather than having to rely on custom Java code within the solution, but for now at least it is a workable solution.

Agree. This is even an incentive for customers and developers to aquire licenses from Servoy.

Are you planning to release your solution as a plug-in or in some other fashion?

Miguel

i don’t think you would be able to do: setActive() a server is active or not. And the active part is if it can connect or not to the database.

Please add a feature request for the active checking and what you need more in our bug/rfe support system:

http://crm.servoy.com/servoy-webclient/ … oy_support

jcompagner:
i don’t think you would be able to do: setActive() a server is active or not. And the active part is if it can connect or not to the database.

Prehaps: isActive() // setCurrent() are better method names / metaphors.

Best,
Miguel

what do you mean with setCurrent() what should that do?