|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
2 Apps with same Database
Hi,
I run 2 application on the same firebird database. The Delphi apps use IBX components (TIBTable), which works fine, but... When the first app adds records to a table, the second app should be able to see them, as it navigates through this table. But it doesn't see the new records at all. As I am pretty new to databases and firebird, I'm obviously doing something wrong. Any idea ? |
|
#2
|
||||
|
||||
|
Shouldn't see them until the first one commits changes
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
AND the second one refreshes its dataset(re-runs the SQL)
Clive |
|
#4
|
|||
|
|||
|
Hi
thx, I was hoping there wouldn't be a refresh neccessary. The two apps are not on the same machine, so the 1st app must tell the 2nd one to refresh. |
|
#5
|
|||
|
|||
|
Quote:
I suggest you consider having Firebird tell all apps (that register an interest) when to refresh. Have a look at Firebird Events. Create an After Insert trigger on the table of interest ant post a firebird event. When the App sees the event it knows it is time to refresh. Clive. |
|
#6
|
|||
|
|||
|
Quote:
Although this works, this is a nice way to clog up your network and the Firebird server, depending on the number of client applications. I wonder: when exactly should the other application see the refreshed data and why? Does it have a "browse" screen open? Cause if so, this is not a very good way of presenting data to a user in client/server systems.
__________________
Martijn Tonies Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
|
#7
|
|||
|
|||
|
Quote:
While your comments are undoubtedly correct, there are also situations in which this can reduce network and server loads (unless I do not understand the way events work - ALWAYS a possibility). I also had the impression that these were limited client situations. Again that might be wrong. I have an example situation where I (unusually) use events and I believe reduce loads. Please let me know if I am wrong. Application Order taking and vehicle dispatch ASAP. Situation: A: A number of people taking orders over the phone plus some electronically sent in. B: A dispatch department displaying all outstanding orders for immediate delivery. The display must always be up to date otherwise vehicles will be dispatched without items that could have been included in the run. Resulting in added delays and costs. It seemed to me that posting an event in an after insert trigger would mean only polling for an event, which I assumed to be lightweight. A full refresh of all the data is only required when the event is posted instead of on a timer. Am I misguided? Clive. |
|
#8
|
|||
|
|||
|
Hi Clive,
No, you're not misguided, there are proper uses for events, but not just any client/server system should use them. Imagine an ERP application with hundreds of client applications all browsing for "orders" of a particular status. Imagine they all registered for an event "NEW_ORDER" and this get's posted on every new order. At the moment of a new order, each of these client machines would then - at the same time! - try to refresh their screens. Now, that is just asking for trouble. EVENTs have their usuage, when used in a smart way. |
|
#9
|
|||
|
|||
|
I agree!
The way the question was posed I assumed (with no proof) that it was very limited use. You were right to point out the potential pitfalls. |
|
#10
|
|||
|
|||
|
Sounds good :)
Hi,
yes, Clive, you're perfectly right, it's a very limited Client/Server App. It's a jukebox application where just 2 Clients are present in the network, the jukebox itself and an administration app, which is running on another pc, where you can import songs and rip CDs to insert them into the jukebox list without disturbing the jukebox. Letting firebird post an event sounds very good to me, actually I don't know how to do this. I guess theres's something about it in IB Documentation. Thank you all, this is helping me a lot. Peter |
|
#11
|
|||
|
|||
|
Works perfectly !
Thx again. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > 2 Apps with same Database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|