Guid PrimeKey as Row Guid for Replication


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I am using Guid's a Primary Keys and also as Rowguid's for replication. The issue is on update's, If a field is specifed as rowguid it cannot be updated so the update fails.

I made the following changes to make this work can you please add to your code so I dont break at next update? or let me know how and what you want to change so I dont get a suprise next update Smile

Thanks

Paul

To Business layer I added this Property. (with a private as well)

''' <summary>

''' Gets or sets a value that determines whether the primary key for this business object is

''' a RowGuid

''' </summary>

''' <value></value>

''' <returns></returns>

''' <remarks></remarks>

<Category(EDITOR_CATEGORY_CRUD), _

DefaultValue(True), _

Description("Determines whether the primary key for this business object is a RowGuid.")> _

Public Property PrimaryKeyIsRowGuid() As Boolean

Get

Return Me._PrimaryKeyIsRowGuid

End Get

Set(ByVal value As Boolean)

Me._PrimaryKeyIsRowGuid = value

End Set

End Property

 

And in Data Layer

In method BuildUpdateInfo aroung line 573

'----------------------> Paul made a change the code here from

'--this

'-- Add the pk field to the fields to update if the primary key if not

' auto incremented

' If Not Me._BusinessObject.PrimaryKeyIsAutoIncremented Then

' loInfo.Fields.Add(lcFieldName)

' End If

'---> to

'-- Add the pk field to the fields to update if the primary key if not

' auto incremented or Row-Guid

If Not Me._BusinessObject.PrimaryKeyIsAutoIncremented AndAlso Not Me._BusinessObject.PrimaryKeyIsRowGuid Then

loInfo.Fields.Add(lcFieldName)

End If


Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, looks like I'll need to include the PrimaryKeyIsUpdatable property.  I'll get started on it and let you know when it's done. 

Incidentally, this probably would have fixed Rob Toyias's issue the other day, too; it had to do with the Oracle PK being passed twice for non updatable PKs.

Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Thanks Ben that should work!
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Peter,

I think what you describe is how transactional replication works, I am using merge replication and it seems to work just fine except for the problem I described. I'm not expert on replication so I could be wrong but from what I've read about merge replication it should work ok.

Paul

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Paul Chase - 18 Years Ago
Chan - 18 Years Ago
Paul Chase - 18 Years Ago
                 Paul, did you try adding the PK field name to the...
StrataFrame Team - 18 Years Ago
Paul Chase - 18 Years Ago
Richard Keller - 18 Years Ago
Richard Keller - 18 Years Ago
Paul Chase - 18 Years Ago
Richard Keller - 18 Years Ago
             Hi,
Any other comments?
Chan - 18 Years Ago
Paul Chase - 18 Years Ago
Peter Jones - 18 Years Ago
Paul Chase - 18 Years Ago
Peter Jones - 18 Years Ago
StrataFrame Team - 18 Years Ago
                 ThanksBen that should work!
Paul Chase - 18 Years Ago
Paul Chase - 18 Years Ago
Richard Keller - 18 Years Ago
StrataFrame Team - 18 Years Ago
Paul Chase - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         Yep I know how it is:) Thanks for getting this in the next build for...
Paul Chase - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search