Stored Procedures - General


Author
Message
Gary C Wynne
Gary C Wynne
StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)
Group: Forum Members
Posts: 26, Visits: 236
Hi,

I have played around with the Database Toolkit and noticed the auto-generated stored procedures for Update and Insert actions. The Insert procedures return @@IDENTITY for the PK but we use SCOPE_IDENTITY() for total accuracy. We have found that returning @@IDENTITY can cause confusion ie., return the wrong value, particularly where inserts are made in triggers that are triggered by the initial insert. Any thoughts?

Is row versioning handled in any way for updates?

How is concurrency handled - after checking the generated stored procedures, there appears to be no specific provision made for row version conflicts or generally concurrency checking.

In Strataframe, is the mapping of business object properties to stored procedure parameters handled automatically?

Thanks,

-=Gary

StrataFrame Team
S
StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, the mapping of the DataColumns to the stored procedure parameters is handled automatically.



For concurrency, the auto-generated stored procedures do not handle concurrency in any way, shape, or form. In the Application Framework, if you set the concurrency to optimistic on a business object, it will not use stored procedures for updates, but rather, will dynamically build an update command that uses either "all fields" or a "timestamp column" for the concurrency. You could, of course also use transactions to implement pessimistic concurrency, but very few ever want to do that Wink



On the @@IDENTITY vs SCOPE_IDENTITY(), we have considered using SCOPE_IDENTITY(), but @@IDENTITY will return the proper value unless you are inserting on multiple tables on the same connection. We have not, however, considered inserting new records on a trigger; we will consider this and most likely change to SCOPE_IDENTITY(). Thanks for the heads up.
Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
The framework now uses SCOPE_IDENTITY and has for some time now.  I thought I would just update this thread so anyone reading would know.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search