ado. net - An event was unable to invoke any of the subscribers

Discussion in 'ASP .Net Web Services' started by ss, Feb 15, 2006.

  1. ss

    ss Guest

    I am working with distributed transactions. When I open and close the
    database
    multiple times within one single distributed transaction, then the 11th
    time
    fails when the database is closed. I receive "An event was unable to
    invoke any of the subscribers". Any help is greatly appreciated.
    Sample version of my code is as follows:

    ServiceConfig cfg = new ServiceConfig();
    cfg.Transaction = TransactionOption.Required;
    ServiceDomain.Enter(cfg);

    for (int i = 0; i < 20; i++) {
    using (SqlConnection conn = new

    SqlConnection("server=.;database=pubs;Trusted_Connection=Yes;Enlist=false;"))
    {
    conn.Open();
    conn.EnlistDistributedTransaction((ITransaction)
    ContextUtil.Transaction);
    using (SqlCommand cmd = new SqlCommand("update authors set au_lname =
    au_lname", conn)) {
    cmd.ExecuteNonQuery();
    }
    conn.EnlistDistributedTransaction(null);
    }
    }
    ServiceDomain.SetComplete();
    ServiceDomain.Leave();
     
    ss, Feb 15, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nita
    Replies:
    1
    Views:
    891
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    480
    Kevin Spencer
    Dec 17, 2004
  3. Riki
    Replies:
    9
    Views:
    358
    clintonG
    Apr 17, 2005
  4. VB Programmer
    Replies:
    4
    Views:
    470
    John Timney \( MVP \)
    Dec 10, 2005
  5. Tony
    Replies:
    2
    Views:
    327
    Erik Funkenbusch
    May 20, 2007
Loading...

Share This Page