<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : setting isolation level</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : setting isolation level</description>
  <pubDate>Thu, 23 May 2013 14:10:25 -700</pubDate>
  <lastBuildDate>Fri, 24 Oct 2008 05:47:13 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=971</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>setting isolation level : Hi,I post how to extract the connection...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3529#3529</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 971<br /><strong>Posted:</strong> 24-Oct-2008 at 5:47am<br /><br />Hi,<br>I post how to extract the connection string as it might be of interest for others.<br><table width="99%"><tr><td><pre class="BBcode">&nbsp; PersistenceManager manager = new PersistenceManager();<br>&nbsp; string keyName = manager.GetDataSourceKey(typeof(MyEntity)).Name; // or "Default"<br>&nbsp; string oleDbConnString = RdbKey.LocateRdbKey(keyName).ConnectionString;<br></pre></td></tr></table><br>You can then use it directly.<br><table width="99%"><tr><td><pre class="BBcode">using (OleDbConnection sqlConn = new OleDbConnection(oleDbConnString))<br>{<br>&nbsp; OleDbCommand&nbsp; cmd = new OleDbCommand("Select count(*) from MyTable");<br>&nbsp; cmd.Connection = sqlConn;<br>&nbsp; sqlConn.Open();<br>&nbsp;&nbsp;&nbsp; count = (Int32)(cmd.ExecuteScalar());<br>&nbsp; sqlConn.Close();<br>}<br></pre></td></tr></table><br>NB: if you plan to use a SqlClient.SqlConnection then you must remove the <strong>"provider"</strong> part of the oledb connection string.<br><br>Hope this helps<br>]]>
   </description>
   <pubDate>Fri, 24 Oct 2008 05:47:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3529#3529</guid>
  </item> 
  <item>
   <title>setting isolation level : Every PM has as associated RdbKey,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3524#3524</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 971<br /><strong>Posted:</strong> 23-Oct-2008 at 9:17am<br /><br />Every PM has as associated RdbKey, and every RdbKey has a connection string.]]>
   </description>
   <pubDate>Thu, 23 Oct 2008 09:17:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3524#3524</guid>
  </item> 
  <item>
   <title>setting isolation level : Hi David,Thank you for your answer....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3521#3521</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 971<br /><strong>Posted:</strong> 22-Oct-2008 at 11:41pm<br /><br />Hi David,<br>Thank you for your answer. <br>It is important to do both the read and the write in the same transaction as it is used by a unique number generator (and I am on the server). <br>This is the only thing I ever do with this class so it's ok to fall back to ado.net. <br>The motivation for handling this with devforce was to avoid managing a connection string. I guess that I can quite easily get the connection string from the rdbkey but I would greatly appreciate any tips on how to build a sqlConnection string from a pm. :)<br><br>]]>
   </description>
   <pubDate>Wed, 22 Oct 2008 23:41:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3521#3521</guid>
  </item> 
  <item>
   <title>setting isolation level : If you want to do both the fetch...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3518#3518</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 971<br /><strong>Posted:</strong> 22-Oct-2008 at 1:06pm<br /><br /><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">If you want to do both the fetch and the save within a single transaction, this is something which we don’t directly support</P><DIV></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">If&nbsp;you truly need a single transaction containing both the query and save, then&nbsp;you will need to create&nbsp;your own TransactionScope and do the calls within that. &nbsp;If&nbsp;you are 2-tier&nbsp;you can do this fairly easily, but if n-tier this would have to be done on the server, so&nbsp;you would need to call some sort of RPC method which created the TransactionScope and then did the logic.</SPAN></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 22 Oct 2008 13:06:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3518#3518</guid>
  </item> 
  <item>
   <title>setting isolation level : Hi,I have a small transaction...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3511#3511</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 971<br /><strong>Posted:</strong> 21-Oct-2008 at 3:40am<br /><br />Hi,<br>I have a small transaction that should run with a high isolation level. I don't manage to set the transaction level, could you give me an example or a pointer to the documentation.<br>I want to do something similar to<br><table width="99%"><tr><td><pre class="BBcode"><br>CREATE PROCEDURE &#091;dbo&#093;.&#091;MyProc&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @serieType char(2) = null,<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @antall int = 1,<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @firstIdx int = null OUTPUT<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ) <br><br>&nbsp;SET NOCOUNT ON<br>&nbsp;declare @current int, @maks int, @new_current int<br>&nbsp;SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;<br>&nbsp;&nbsp; begin transaction<br>&nbsp;&nbsp;&nbsp; SELECT @current = &#091;currentNr&#093; , @maks = &#091;MaxNr&#093;<br>&nbsp;&nbsp;&nbsp; FROM &#091;dbo&#093;.&#091;SERIE&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp; WHERE serieType = @serieType<br>&nbsp;&nbsp;&nbsp;&nbsp; if @current is not null<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;some logic&#093;<br>&nbsp;&nbsp; commit<br><br></pre></td></tr></table><br>I tried something like:<br><table width="99%"><tr><td><pre class="BBcode"><br> TransactionSettings transactionSettings = // just want to set isolation level<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new TransactionSettings(UseDTCOption.False);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RdbQuery q = new RdbQuery(typeof(NrSerie));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q.QueryStrategy = new QueryStrategy(QueryStrategy.DataSourceOnly, transactionSettings); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q.AddClause(NrSerieDataRow.SerieTypeEntityColumn, EntityQueryOp.EQ, typecode);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; --- begin transac. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NrSerie serie = pm.GetEntity&lt;NrSerie&gt;(q);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result = serie.Counter;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serie.Counter += 1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;IdeaBlade.Persistence.Entity&gt; l = new List&lt;IdeaBlade.Persistence.Entity&gt;(1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l.Add(serie);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SaveResult saveOperation = pm.SaveChanges(l);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!saveOperation.Ok)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { //roll back<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pm.RejectChanges();//???<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw saveOperation.Exception;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //commit<br></pre></td></tr></table><br>--<br>Dominique<br>]]>
   </description>
   <pubDate>Tue, 21 Oct 2008 03:40:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=971&amp;PID=3511#3511</guid>
  </item> 
 </channel>
</rss>