﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Role Based Security  » RBS Logging Mechanism</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 02:51:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31109.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;We are trying to implement a logging mechanism over the Strataframe RBS. We have written triggers on the RBS tables and in order to pass application values (like the username) to the triggers we are setting the context_info variable of StrataFrame.&lt;br/&gt;&lt;br/&gt;In program.cs:&lt;br/&gt;&lt;br/&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;sSql = &lt;/font&gt;&lt;/font&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;"declare @context_info varbinary(50);set @context_info = cast('"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt; + MicroFour.StrataFrame.Security.&lt;/font&gt;&lt;/font&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;SecurityBasics&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.CurrentUser.UserPK.ToString();&lt;br/&gt;&lt;br/&gt;sSql +=&lt;/font&gt;&lt;/font&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;"@"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt; + sFullIP + &lt;/font&gt;&lt;/font&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;"' as varbinary(50));set context_info @context_info;"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;;&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;DataLayer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;.DataSources[&lt;/font&gt;&lt;/font&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;&lt;font color=#a31515 size=2 face=Consolas&gt;"MySecurityKey"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font size=2 face=Consolas&gt;].ExecuteNonQuery(sSql);&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;We used SQL Server profiler and saw that context_info is properly set with this command.&lt;br/&gt;&lt;br/&gt;When the program loads and I click on the security editor a number of SQL statements are executes with sp_reset and the context_info variable is also cleared. &lt;br/&gt;&lt;br/&gt;We would like to find a method so that context_info is not cleared and our triggers use this information for logging.&lt;br/&gt;&lt;br/&gt;Could you please help&amp;nbsp;us?</description><pubDate>Wed, 18 Apr 2012 02:48:32 GMT</pubDate><dc:creator>lastcanary</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31150.aspx</link><description>No reply?</description><pubDate>Wed, 18 Apr 2012 02:48:32 GMT</pubDate><dc:creator>lastcanary</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31121.aspx</link><description>Yes.</description><pubDate>Tue, 10 Apr 2012 14:28:54 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31120.aspx</link><description>On the client side?</description><pubDate>Tue, 10 Apr 2012 14:13:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31118.aspx</link><description>Hi Trent,&lt;br/&gt;&lt;br/&gt;Thanks a lot for your detailed &lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;explanation.&lt;br/&gt;&lt;br/&gt;we tried to narrow the problem and we believe that&amp;nbsp; if we could catch a event after a new connection open we would solve our problem.&lt;br/&gt;&lt;br/&gt;Can u suggest a way to catch the event after a new connection opened in Strataframework?&lt;br/&gt;&lt;br/&gt;Kind regards...&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;</description><pubDate>Tue, 10 Apr 2012 14:10:30 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31117.aspx</link><description>We took a different approach in our medical application on several different levels.&amp;nbsp; To begin, &lt;span style="font-weight: bold; text-decoration: underline; font-style: italic;"&gt;every&lt;/span&gt; table, has a field that stored the user that created the record.&amp;nbsp; So when the trigger fires, we have everything we needed as part of the new record to query the SFSUsers and get other details if necessary.&amp;nbsp; We also have some client side auditing for the more complex elements.&amp;nbsp; You don't want to do this application wide, but for the most important auditing implementations, we will use BO events and method overrides to capture and log very detailed changes.&amp;nbsp; But like I said, this is not application wide, only in very select and precise areas.&lt;br/&gt;&lt;br/&gt;Just as a word of caution, if you have to be somewhat careful on triggers too.&amp;nbsp; If you over complicate your triggers you can really slow down update and deletion performance which as your application grows can become very noticeable and irritating to the end-user.&amp;nbsp; So just make sure that things are optimized.&lt;br/&gt;&lt;br/&gt;There are 100 ways to work through this, but since I don't know your app, I am just trying to throw out some suggestions.&amp;nbsp; I would abandon the manual setting of the variable though, this can become an issue in other ways depending on how an end-user SQL Server environment is setup.&lt;br/&gt;&lt;br/&gt;One other thought, every time a user logs, a unique session ID is created in our app.&amp;nbsp; This let's us track a complete session for a user from start to finish.&amp;nbsp; This is very handy for calculating many things including up-time, etc.&amp;nbsp; But you could do something similar and use this session ID as part of a compound key for a table that you create that stores the UserPK by session, table, etc.&amp;nbsp; Just be sure to think about mutli-user sessions and what is unique to your session.&amp;nbsp; You could then store this off in a work table that is accessed by the trigger.&lt;br/&gt;&lt;br/&gt;These are just ideas....trying to help get the juices flowing. :)</description><pubDate>Tue, 10 Apr 2012 13:43:12 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31115.aspx</link><description>Hi Trent,&lt;br/&gt;&lt;br/&gt;Let me &lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;clarify our problem :&lt;br/&gt;&lt;br/&gt;All we want is simply pass some variables (such as user name) to MS SQL Triggers for some logging/auditing purposes.&lt;br/&gt;&lt;br/&gt;We try to &lt;/span&gt;&lt;/span&gt;&lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;achieve &lt;/span&gt;&lt;/span&gt;&lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;this by setting context_info variable.&lt;br/&gt;&lt;br/&gt;But this setting is lost with &lt;/span&gt;&lt;/span&gt;&lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl01_lblFullMessage"&gt; sp_reset.&lt;br/&gt;&lt;br/&gt;What is your suggestion about passing varibles to triggers in MSSQL?&lt;br/&gt;&lt;br/&gt;Would you like share your &lt;/span&gt;&lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;experience in your Medical Application&lt;/span&gt;&lt;/span&gt;?&lt;br/&gt;&lt;span id="result_box" class="short_text" lang="en"&gt;&lt;span class="hps"&gt;&lt;br/&gt;Thanks in advance...&lt;br/&gt;&lt;br/&gt;Kind Regards&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;</description><pubDate>Tue, 10 Apr 2012 13:06:27 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: RBS Logging Mechanism</title><link>http://forum.strataframe.net/FindPost31110.aspx</link><description>What command are you trying to execute?&amp;nbsp; I see that you are setting variables, but when and where are you trying to use those variables?&amp;nbsp; Also, this seems a bit precarious in regards to the reliability here because so many other things can get executed.&amp;nbsp; Most likely, the variables are just losing scope by the time they get to you.&amp;nbsp; I see that the profiler caught sp_reset, but this isn't something that we execute directly.</description><pubDate>Tue, 10 Apr 2012 08:41:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>