New Posts New Posts RSS Feed: How does IdeaBlade handle Identity columns
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How does IdeaBlade handle Identity columns

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: How does IdeaBlade handle Identity columns
    Posted: 12-Jul-2007 at 3:47pm

I would just like to ask about how the IdeaBlade handles Identity columns (AutoGenerated Numbers) set on the DB Table?

Does the OR Mapper detect this?

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 3:48pm
Identity columns pose a special problem for IdeaBlade. When a business object that uses an identity column is first created, it is assigned a negative temporary id. Only when the business object gets saved to the database, does the database assign the business object its permanent id. The difficulty with this is that if the PersistenceManager wants to refetch the entity, it doesn't know what permanent id to use.

Devforce solves this problem with a clever approach. Rather than having the database assign the permanent id, we assign it ourselves. We do this be creating a "hole" in the id space. If the last number used by the id generator was 1356 (for example), we create a range of ids from 1357 to 1367 that we own and can't be used by any other user.

The Object Mapper is fully aware of Identity columns.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down