In my server application I have some datasets, connected with TDataSetProvider
In client app, I use TClientDataSet
On some server methods, I changing SQL property of queries, and reloading data in server module.
But nothing changes on client app.
How to solve it in best way?
Thanks.
Related
I'm searching for information on database connectivity (Firebird in my case) with IntraWeb Applications.
I especially need to know the difference(s) involved in using the database on the TDataModule with LockDataModule function, or using the database on the UserSessionUnit.
For example i need to have the database totally disconnected if no users are using the server, and at most 30 users will be connected.
I may at worst have to connect to some old paradox Database and i need a structure that could handle that (i know that i'll have to generate a folder based on WebApplication.AppID to handle sessions). At worst...
Thanks in advance for any piece of information or useful links you could provide me ^^
Scenario 1 - You leave "Pool Data Connections" unchecked in the Intraweb Application Wizard
In this scenario the wizard creates a ServerController, a UserSession but not a DataModule. You place your database, session and dataset components on the UserSession.
Whenever a new user connects to your website a new instance of the UserSession is created and a connection to the database is made. When the ServerController.SessionTimeOut expires due to user inactivity the UserSession is destroyed and that particular connection to the database is severed.
For 30 concurrent users this model will probably be fine for you and should guarantee that all database connections will be severed when the website is not in use.
Scenario 2 - You check "Pool Data Connections" in the Intraweb Application Wizard
As well as the ServerController and the UserSession the wizard will create an empty DataModule. You place your database, session and dataset components on the DataModule.
The ServerModule has a TIWDataModulePool component on it which has PoolCount property.
When your application starts it creates PoolCount instances of the DataModule each one of which makes a connection to the database. As your pages require database access they call LockDataModule and UnlockDataModule to temporarily make use of one of the DataModule instances from the pool.
When your application closes the DataModule instances in the pool are destroyed and their connections to the database are closed.
This model is appropriate when having an open database connection per user would exceed the capabilities of your database server. For just 30 users connecting to a FireBird database I don't believe it would be required.
You may want to consider using a component set like kbmMW by http://www.components4programmers.com/ I have used this for years with Desktop apps ans now with IW apps. I deploy my apps as Services and currently having a few issues deploying as an ISAPI. kbmMW is well suited for an app with lots of connections as it offers connection pooling etc... It has many features and benefits. Check out site for yourself.
I use the Enterprise version, though I think the free version may be useful to you.
Cheers!
-Lou
I have tried to use DataSnap on Advantage Database but I cannot update my data. I use TAdsQuery on datasnap server and return the query to client and link it with TDataSetProvider.
I traced into and saw Delphi applies updates using TSQLConnection not my TAdsConnection I have in server side.
Any idea?
I wrote a white paper for Advantage (Sybase) to show how Advantage Database Server and Delphi's DataSnap work just fine. I'm not sure what/where your problem is exactly.
Check out http://www.drbob42.com/examines/examinD8.htm for the DataSnap Server and http://www.drbob42.com/examines/examinD9.htm for the client.
The DataSnap client uses a TSQLConnection to talk to the DataSnap Server. The DataSnap Server uses a TAdsConnection to talk to the Advantage Database Server. The client never has any "knowledge" about the actual database; that's what the server is for.
Groetjes, Bob Swart
I am writing an application that extracts data from a file and then saves the data in a MS Access database. I now want to write a client for this program where users can view the data with a nice GUI. How do I connect the client on another PC to the database on my PC using Delphi? For starters I would just like to display the MS Access Data in a DB Grid. I have never worked with networking before in Delphi.
There are lots of ways to do this. One simple way is just to set up an ODBC connection to the database (using ODBC administrator). It doesn't matter if this database is over the network - just map a drive or use a fully qualified name.
You then have a choice of components you can use to connect to the database. ADO is a good choice for Access. For starters try using a TADOQuery, TDataSource and data aware component such as a TDBGrid. There is plenty of documentation on how to uses these in the delphi help.
We have a requirement where a Grails application is required to connect to an external SQL Server 2005 (i.e. client's database server via a linked server). Our grails application will have its own SQL Server database instance for user authentication (so will mostly have only one domain class) and then it needs to connect to the external SQL Server database to fetch (only SELECT permission provided) data from 10 or 15 tables (out of 250 tables available) and show it the grails application.
I would like to know would be the best approach to take in this scenario.
Thank You.
Jay Chandran.
You can use the http://grails.org/plugin/datasources plugin and configure the external server as a read-only datasource to ensure that only reads are performed. If you don't want to map domain classes on that server you can use groovy.sql.Sql to execute SQL queries.
What are the advantages in using DataSnap compared to writing a
soapserver application.
I know Datasnap can use TCP/IP instead of soap.
Regards
Sandeep
With DataSnap you can export any number of datasets, and server methods, without the need of manually serialize them, adding built-in funcionality of parameterized querys, in wich value of the parameters are defined from the client. On the client side, you just have to connect to the remote datasource or methods to any data aware control using a ClientDataSet as data cache, with automatic update command generation.
SOAP is a more raw way to do everything, and IMHO the only thing you gain using WS is compatibility. If you are not using Delphi on the client side, then that is the way to go.
DataSnap is a remoting technology which directly supports Delphi database architecture. Actually DataSnap supports SOAP too - check the TSoapConnection component (but of course a plain SOAP server is not a Datasnap server also).
Be aware that currently exists two Datasnap implementation. The "older" one using DCOM/SOAP and a "newer", dbExpress-based one, supporting TCP and HTTP/REST.