<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Lightswitch using sqlanywhere data source in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845961#M4876804</link>
    <description>&lt;P&gt;I have had a similar problem using ODBC inside a Workflow Foundation project in .net 3.5
Do you have nested transactions in your project?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2011 02:15:36 GMT</pubDate>
    <dc:creator>MCMartin</dc:creator>
    <dc:date>2011-08-11T02:15:36Z</dc:date>
    <item>
      <title>Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaq-p/13845955</link>
      <description>&lt;P&gt;Has anyone been able to create a silverlight application with SQL Anywhere?
I can create an application only on the same machine running the database.  In addition I cannot update... the error is: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Cannot begin a transaction because the
connection is already enlisted in a
transaction&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 08 Aug 2011 10:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaq-p/13845955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T10:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845956#M4876799</link>
      <description>&lt;P&gt;I am able to use sqlAnywhere 12 with Microsoft's New Visual Studio lightswitch only using WCF RIA service as the datasource running in 3 tier deployment to the SqlAncywhere server running the IIS server it is deployed on. However, I can run a silverlight 3 tier WCF Ria service and connect to a remote SQLAnywhere database server.  I continue to have no luke running Lightswitch against a remote database server either in 2 tier or 3 tier (WCF Ria servce data source).  On two tier I also continue to get the transaction cannot beging because it is already enlisted.  Beign that VS Lightswitch is suppose to be using underlying silverlight EF, MVVM, WCF Ria technologies, I am not sure why I continue to experience this.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2011 11:03:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845956#M4876799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T11:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845958#M4876801</link>
      <description>&lt;P&gt;Are you explicitly begining a transaction or is this done by some magic hidden stuff in Lightswitch?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2011 12:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845958#M4876801</guid>
      <dc:creator>MCMartin</dc:creator>
      <dc:date>2011-08-10T12:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845959#M4876802</link>
      <description>&lt;P&gt;It is hidden Lightswitch stuff of which I have no visibility.  3 tier update works thru WCF Ria datasource (but only ls running on the db server) but 2 tier update does not.    There must be a difference on how Microsoft is creating the transaction againt the ria data source verses the 2 tier database entities under the covers.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2011 12:30:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845959#M4876802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-10T12:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845960#M4876803</link>
      <description>&lt;P&gt;I'm not familiar with Lightswitch (nor EF). - But can you somewhat check whether you are getting connected to the database server at all - particularly when the database server is running on a different machine?&lt;/P&gt;
&lt;P&gt;calling &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/sa-conn-info-sysproc.html"&gt;sa_conn_info()&lt;/A&gt; from dbisql(c) might help to find out more...&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2011 16:54:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845960#M4876803</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-08-10T16:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845961#M4876804</link>
      <description>&lt;P&gt;I have had a similar problem using ODBC inside a Workflow Foundation project in .net 3.5
Do you have nested transactions in your project?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 02:15:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845961#M4876804</guid>
      <dc:creator>MCMartin</dc:creator>
      <dc:date>2011-08-11T02:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845957#M4876800</link>
      <description>&lt;P&gt;Doing a quick web search it seems that your problem is affecting multiple database products not only SQL Anywhere.&lt;/P&gt;
&lt;P&gt;A solution I have found but have not tested is:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;You&lt;/SPAN&gt; &lt;SPAN class="n"&gt;must&lt;/SPAN&gt; &lt;SPAN class="n"&gt;define&lt;/SPAN&gt; &lt;SPAN class="n"&gt;a&lt;/SPAN&gt; &lt;SPAN class="n"&gt;transaction&lt;/SPAN&gt; &lt;SPAN class="n"&gt;handling&lt;/SPAN&gt; &lt;SPAN class="k"&gt;for&lt;/SPAN&gt; &lt;SPAN class="n"&gt;your&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Data&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Source&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;OL&gt;
&lt;LI&gt;Switch to the File View of your LightSwitch Solution. &lt;/LI&gt;
&lt;LI&gt;Select the "Server" Project and add a reference to "System.Transactions".&lt;/LI&gt;
&lt;LI&gt;Open the Code for your Data Source (Right-Click on your Data Source --&amp;gt; Show/View Code)&lt;/LI&gt;
&lt;LI&gt;Declare a using for System.Transactions:
using System.Transactions;&lt;/LI&gt;
&lt;LI&gt;Enter following code snippet:&lt;/LI&gt;
&lt;LI&gt;List item&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;public partial class YOURDATASOURCE
{
private TransactionScope _tscope;&lt;/P&gt;
&lt;P&gt;partial void SaveChanges_Executing()
{
_tscope = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions
{
IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted
});
}&lt;/P&gt;
&lt;P&gt;partial void SaveChanges_Executed()
{
_tscope.Complete();
_tscope.Dispose();
}
}&lt;/P&gt;
&lt;P&gt;In general if this doesn't work directly it seems to be a good idea to dig into the possibilities you have with using the TransactionScope class from .net to influence the enlistment of DataSources.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 02:58:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845957#M4876800</guid>
      <dc:creator>MCMartin</dc:creator>
      <dc:date>2011-08-11T02:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845962#M4876805</link>
      <description>&lt;P&gt;I'm having the exact same problem as Busch: retrieving data from an sql anywhere db in a lightswitch app is fine. But as soon as I save a new or edited entity, I get "Cannot begin a transaction because the connection is already enlisted in a transaction.".
&lt;A href="https://sqlanywhere-forum.sap.com/users/321/busch/"&gt;@Busch&lt;/A&gt;: are you working with a normal or an OEM database? (Mine is an OEM.)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 06:01:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845962#M4876805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-03T06:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lightswitch using sqlanywhere data source</title>
      <link>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845963#M4876806</link>
      <description>&lt;P&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/404/cheeta/"&gt;@Cheeta&lt;/A&gt;: Have you had a chance to check out the solution from my answer: creating a TransactionScope?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2011 07:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/lightswitch-using-sqlanywhere-data-source/qaa-p/13845963#M4876806</guid>
      <dc:creator>MCMartin</dc:creator>
      <dc:date>2011-10-06T07:31:43Z</dc:date>
    </item>
  </channel>
</rss>

