TORATable 'live view'

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

TORATable 'live view'

Post by h.hasenack » Wed 25 Mar 2009 15:20

Hello

I'm currently implementing ODAC as an alternative to NexusDB, and I have already come very far. My App in fact runs!

Here's still some trouble:
I'm used to using 2 table components for access to the same DB table, one for editing, and one for looking up data.

Here 's the trouble: when a record is posted using the edit table, the record cannot be found (using eg findkey, locate) in the lookup table. Well, until the table is closed and opened.

Any idea how to come by this? I need the 2nd table e.g. for my custom Data aware TTree component that loads nodes from the lookup table, but does the navigating on the edit table.

Regards - Hans

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 26 Mar 2009 08:09

You should call the Refresh method for your lookup table after posting a record to the edit table.

h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

Post by h.hasenack » Thu 26 Mar 2009 10:14

Plash wrote:You should call the Refresh method for your lookup table after posting a record to the edit table.
I am trying to avoid changing my program logic as much as possible. Adding a refresh for each afterpoast/afterdelete event is rather tedious.

Currently I use "locate" and "findkey" to locate the posted record. Does "Refresh" do something else but reloading the 'current' record? (like re-execute the entire query?)

Maybe the solution is in the using ChangeNotify component... (No luck so far)

UPDATE
I tried using SmartRefresh=True, but it causes an AV. Why? Do i need pro or dev version? I'm still using the evaluation version.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 27 Mar 2009 07:54

The Refresh method reloads the whole dataset. You can use the Locate method, and then RefreshRecord method to reload only record that was changed.

Using the TChangeNotification component is not recommended because it may require special server configuration to work normally.

SmartRefresh should work in Trial edition. We cannot reproduce an access violation. Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

Post by h.hasenack » Fri 27 Mar 2009 08:31

You can use the Locate method, and then RefreshRecord method to reload only record that was changed.
Locate/findkey is unable to find a new record that has just been posted in the other instance of TOraTable. I guess this renders using refreshrecord for new records impossible. (not tested yet). RefreshRecord is probably only available for pre-existing records.

Using the TChangeNotification component is not recommended because it may require special server configuration to work normally.
Yes I noticed. changing the security didn't help.
Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.
I'll have to look into that one if I can find the time.

Regards

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 30 Mar 2009 07:19

Yes, the Locate method cannot find a record that was added to another instance of TOraTable. If you add a new record, you can call the Refresh method to reload all data. When you edit an existing record you can use the RefreshRecord or Refresh methods.

Post Reply