Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 4th, 2006, 08:04 AM
kepptenkuck kepptenkuck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 4 kepptenkuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 4 sec
Reputation Power: 0
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 ?

Reply With Quote
  #2  
Old October 4th, 2006, 09:06 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,907 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 9 h 21 m 6 sec
Reputation Power: 279
Shouldn't see them until the first one commits changes

Reply With Quote
  #3  
Old October 4th, 2006, 10:40 AM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
AND the second one refreshes its dataset(re-runs the SQL)

Clive
Comments on this post
pabloj agrees: Seems obvious but it's worth mentioning it!

Reply With Quote
  #4  
Old October 5th, 2006, 07:59 AM
kepptenkuck kepptenkuck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 4 kepptenkuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 4 sec
Reputation Power: 0
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.

Reply With Quote
  #5  
Old October 5th, 2006, 10:43 AM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
Quote:
Originally Posted by kepptenkuck
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.

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.

Reply With Quote
  #6  
Old October 6th, 2006, 01:15 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
Quote:
Originally Posted by clivew
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.


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.
Comments on this post
pabloj agrees: Couldn't agree more
__________________
Martijn Tonies
Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
Upscene Productions
http://www.upscene.com

Reply With Quote
  #7  
Old October 6th, 2006, 12:25 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
Quote:
Originally Posted by upscene
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.

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.

Reply With Quote
  #8  
Old October 6th, 2006, 12:30 PM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 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.

Reply With Quote
  #9  
Old October 6th, 2006, 01:08 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
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.

Reply With Quote
  #10  
Old October 9th, 2006, 04:38 AM
kepptenkuck kepptenkuck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 4 kepptenkuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 4 sec
Reputation Power: 0
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

Reply With Quote
  #11  
Old October 9th, 2006, 06:39 AM
kepptenkuck kepptenkuck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 4 kepptenkuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 4 sec
Reputation Power: 0
Works perfectly !

Thx again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > 2 Apps with same Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |