New Posts New Posts RSS Feed: Where is the DataAdapter's RowUpdated Event
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Where is the DataAdapter's RowUpdated Event

 Post Reply Post Reply
Author
johneevo View Drop Down
Newbie
Newbie


Joined: 03-Dec-2007
Location: United States
Posts: 8
Post Options Post Options   Quote johneevo Quote  Post ReplyReply Direct Link To This Post Topic: Where is the DataAdapter's RowUpdated Event
    Posted: 04-Dec-2007 at 4:47pm
Hi David,

Thanks for the reply.

Originally posted by davidklitzke

We do handle the problem of retrieving a newly generated identity column from the database and then matching it up with the appropriate object in the cache as it completes its roundtrip.  If you want to, we are happy to allow you to use this mechanism
 


Can you tell me how and were you do this and, more importantly, how I can use it. My understanding of how IdeaBlades works is that before updates are issued to the DB your framework calls the ConvertTempIdsToRealIds method. This method gets the next identity value(s) from the DB prior to submitting any inserts to the DB and updates the appropriate entities and their child entities. This approach does not work for the version of Informix that we are using. We need to perform the actual insert and then the DB generates the next identity value (or in Informix speak, the next serial value). Then before any other sql statements are executed, we need to get the newly generated serial value from the DB. Then of course we need the entity to be updated with this value and any children entities to have their linking columns updated before they are saved to the DB.

Hopefully I am just missing something here and you do have a mechanism built in to support this.

Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 03-Dec-2007 at 10:32pm
We do handle the problem of retrieving a newly generated identity column from the database and then matching it up with the appropriate object in the cache as it completes its roundtrip.  If you want to, we are happy to allow you to use this mechanism
 
We also give you cimplete control of generating the keys for your new objects, so if you want you want to take complete control of this, you just need to hook into the IdGenerator interface.  For more details, see the Developer's Guide.
 
However, if you just want to hook up to an event that happens just before and after each save to the PersistenceManager, use the Saving and Saved Events.   Just before database save, the Saving event fires and you are free to modify the properties of each object before they go to the database.  The database then fixes up the keys as they are being saved.  After the the database save, the PersistenceManager roundtrips the data, and fires the Saved event, during which you can update the data.

 
Back to Top
johneevo View Drop Down
Newbie
Newbie


Joined: 03-Dec-2007
Location: United States
Posts: 8
Post Options Post Options   Quote johneevo Quote  Post ReplyReply Direct Link To This Post Posted: 03-Dec-2007 at 7:10am
Hi everybody,

We are evaluating the use of IdeaBlades against an Informix database. Our existing database heavily uses serial columns. As I understand it IdeaBlades does not come with support for serial columns. By "support for serial columns" I mean that there is no support for retrieving the newly generated serial value from the database and updating the appropiate entity with it.

So I thought I might be able to handle the DataAdapter's RowUpdated event to step in and retrieve the newly generated serial value from the database and update the entity myself. Unfortunately I can't found where IdeaBlades surfaces this event. Can anybody tell me how I can handled this event using IdeaBlades?

Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down