Client Side Data Storage using HSQLDB
3 posts
• Page 1 of 1
Client Side Data Storage using HSQLDB
Good day everyone!
As the topic suggest, would that be easier to do in JVx Framework? My reason for asking , is that, here in our country (Philippines), we always experience electricity brownout for hours, so the possibility of the client program to be disconnected with the remote server is very high. I don't want the client side program to become "useless" once the server is no longer available, like most web-based applications.
So, the idea is that the client program will switch connection to a local HSQLDB and a separate thread will do the uploading of records once the remote server is available again.
Any idea will be very much appreciated.
Thanks.
As the topic suggest, would that be easier to do in JVx Framework? My reason for asking , is that, here in our country (Philippines), we always experience electricity brownout for hours, so the possibility of the client program to be disconnected with the remote server is very high. I don't want the client side program to become "useless" once the server is no longer available, like most web-based applications.
So, the idea is that the client program will switch connection to a local HSQLDB and a separate thread will do the uploading of records once the remote server is available again.
Any idea will be very much appreciated.
Thanks.
- reycat67
- Posts: 4
- Joined: Fri Nov 05, 2010 12:33 am
Re: Client Side Data Storage using HSQLDB
The framework does not support database switching (online/offline) and data synchronization out-of-the-box, but it is possible with JVx to realize this.
Which kind of web applications do you mean because JSF, GWT, JSP, HTML, Tapestry - general Ajax/HTML - apps does not work without server. I think, HTML5 storage API is something in this direction but not for large business apps and old browser versions does not support the API.
But before we discuss about facts, you should know that online/offline/online applications can generate a lot of problems, because
You can use JVx to write multi tier applications but it is also not a problem to use apps as 2 tier (only change the connection) or as standalone desktop app (e.g. DirectServerConnection, ...).
The RemoteDataBook supports memory filtering and sorting:
If you use memory sort/filter, then all data will be fetched, like
If you set the the writeback isolation level to
then the changed data will be sent to the server if you call
If the server connection is interrupted, the server kills the session after the configured timeout. To change timeouts see Configuring Timeouts.
Another solution for your problem is, to use one RemoteDataBook for your local database and a RemoteDataBook for your remote server. To use a RemoteDataBook you can use the DirectObjectConnection (experimental in the repository - test source). This connection does not need a server and is used for test cases at the moment. Your UI should use the local RemoteDataBook and synchronize (manually - simple get/setValues) it with your server RemoteDataBook, if the server is available.
Also possible: Every client has its own database and loads all data from the server database and when possible the client writes all data to the server database (we don't recommend to use this option).
I hope this helps.
Which kind of web applications do you mean because JSF, GWT, JSP, HTML, Tapestry - general Ajax/HTML - apps does not work without server. I think, HTML5 storage API is something in this direction but not for large business apps and old browser versions does not support the API.
But before we discuss about facts, you should know that online/offline/online applications can generate a lot of problems, because
- you need syncronized databases (tables, views, ...) (for client and server) - automatic migration
- data synchronization
- multi user problems when editing same records/tables
- transactions
- ...
You can use JVx to write multi tier applications but it is also not a problem to use apps as 2 tier (only change the connection) or as standalone desktop app (e.g. DirectServerConnection, ...).
The RemoteDataBook supports memory filtering and sorting:
- Code: Select all
<RemoteDataBook>.setMemFilter(true);
<RemoteDataBook>.setMemSort(true);
If you use memory sort/filter, then all data will be fetched, like
- Code: Select all
<RemoteDataBook>.fetchAll();
If you set the the writeback isolation level to
- Code: Select all
IDataBook.WriteBackIsolationLevel.DATASOURCE
then the changed data will be sent to the server if you call
- Code: Select all
<RemoteDataBook>.saveAllRows();
If the server connection is interrupted, the server kills the session after the configured timeout. To change timeouts see Configuring Timeouts.
Another solution for your problem is, to use one RemoteDataBook for your local database and a RemoteDataBook for your remote server. To use a RemoteDataBook you can use the DirectObjectConnection (experimental in the repository - test source). This connection does not need a server and is used for test cases at the moment. Your UI should use the local RemoteDataBook and synchronize (manually - simple get/setValues) it with your server RemoteDataBook, if the server is available.
Also possible: Every client has its own database and loads all data from the server database and when possible the client writes all data to the server database (we don't recommend to use this option).
I hope this helps.
-
Support@SIB - Posts: 355
- Joined: Mon Sep 28, 2009 1:56 pm
Re: Client Side Data Storage using HSQLDB
I think the best solution to my problem is to use one RemoteDataBook for local database and another RemoteDataBook for remote server.
Thank you very much Sir!
Thank you very much Sir!
- reycat67
- Posts: 4
- Joined: Fri Nov 05, 2010 12:33 am
3 posts
• Page 1 of 1