StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Customise Stored Procedure UpdatesExpand / Collapse
Author
Message
Posted 08/15/2006 2:56:54 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 08/15/2006 9:37:51 AM
Posts: 3, Visits: 10
Hi,

I have just downloaded the trail version and like the idea of being able to use stored procedures to handle the updates as this is our company policy. However looking at the documentation it seems that these stored procedures are being generated by the framework. We have have special requirements for the parameters passed E.G. Orginal values,update field flags and session information for logging who made the change.

In essence the parameters look something like this

create procedure dbo.smEXPSMASTER_ACD
     @I_ACTION  char(1) ='',
     @I_IDKEY  IDKey =0,
     @I_TSTAMP  timestamp =null,
     -- Input Data Fields
     @I_USERCODE   UserCode  = '',
     @I_NAME    varchar(35)  = '',
     @I_NOMCODE   UserCode  = '',
     -- Update Flags
     @I_UPD_USERCODE   bit  = 0,
     @I_UPD_NAME   bit  = 0,
     @I_UPD_NOMCODE   bit  = 0,
     -- Original Values
     @I_ORG_USERCODE   UserCode  = '',
     @I_ORG_NAME    varchar(35)  = '',
     @I_ORG_NOMCODE   UserCode  = '',
     -- Progress Parameters
     @I_PROG_SPID  int  =0,
     -- Session Parameters
     @I_SESS_USERID  IDKey  =0,
     @I_SESS_USERNAME UserCode ='',
     -- Audit Parameters
     @I_NOAUDIT_LOG  bit  =0,
     @I_AUDIT_MESG  varchar(255) ='',
     @I_AUDIT_SOURCE  varchar(1) ='L',
     -- Output Parameters
     @O_IDKEY  int  =0 output,
     @O_ERROR_TABLE  varchar(30) ='' output,
     @O_ERROR_USERCODE UserCode ='' output,
     @O_RETURN  int  =0 output,
     @O_MESG   varchar(100) = '' output

The question is how far can you go in customizing the CRUD stored procedures to allow me to call something like the above.

Thanks

Paul

Post #2189
Posted 08/15/2006 5:39:08 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 08/15/2006 9:37:51 AM
Posts: 3, Visits: 10
Apologies for putting this in the wrong forum section.
Post #2190
Posted 08/15/2006 8:30:04 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:38:53 PM
Posts: 2,683, Visits: 1,883
You can customize the CRUD stored procedures to the extent of being able to choose the parameter prefix for the names, however, when a business object saves a record, it is expecting to be able to determine the parameters necessary for the UPDATE/INSERT from the fields within the business object.  We have no method you to pass extra parameters to a stored procedure.

We do have some functionality to support much of the information you're trying to save off through our security module, which supports built-in auditing for INSERTs/UPDATEs/DELETEs and application level events.  It stores of the information so you can see what user did what within the application.  Like I said, though, we don't have the functionality for you to pass the extra parameters into the stored procedures.

Apologies for putting this in the wrong forum section.

Awe, no problem.  I almost never check what section people post a question to; I just get an email letting me know that a new post exists


www.bungie.net
Post #2191
Posted 08/15/2006 9:25:11 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 08/15/2006 9:37:51 AM
Posts: 3, Visits: 10
Thanks for the reply. This might be an issue as we are doing a bit more than just pure auditing.Not having access to the source code, what about a suggested change for the next release where you provide the ability to decorate the SQLCommand object with additional parameters via a call to a custom decorating class which is written outside of the framework.

By this I mean
1. Presistance of object is called.
2. If saving via stored proc then do all of the work to prepare the proc with all the parameters you expect.
3. Check if a custom interface/provider/decorator has been injected into the framework and call it to modify the SQLCommand object with additional parameters etc..
4. Fire the SQLCommand object to save the data.

This then gives greater flexibility to us without compromising the framework.

Also if I buy the product.I see it says it comes with source code. To what extent could I modify the framework to allow such customisations. I can see it would not be a great idea given the amount of work you guys must have put in, but maybe that is another angle to look at.

Thanks

Post #2192
Posted 08/15/2006 9:34:26 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:38:53 PM
Posts: 2,683, Visits: 1,883
Yes, the ability to allow additional parameters to be passed to the executing stored procedures is on our long term list of feature improvements.  By long term, I mean most likely it will be included with the .NET 3.0 release when we can support DLinq within StrataFrame. 

The easiest way to provide the functionality right now would be to create your own DbDataSourceItem implementation and when the UpdateRow method is called, raise an event that allows you to add the additional parameters to the command that is being executed.  You could even use the SqlDataSourceItem as a base class since you only need to override the UpdateRow method.


www.bungie.net
Post #2193
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 4:29am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.