Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:01:11+00:00 2026-06-07T15:01:11+00:00

I am trying to trigger a url from a trigger in SQL Anywhere and

  • 0

I am trying to trigger a url from a trigger in SQL Anywhere and not wait for the response.

In SQL Anywhere I have the following function:

CREATE FUNCTION "DBA"."sendCallback"( in @serverip text,in @url text ) 
returns char(255)
not deterministic
external name 'Callback.dll::Namspace.Callback.OpenUrlAsync(string, string) string' language CLR

And in C# I have the following program:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net;
using System.ComponentModel;

namespace Namspace
{
    public static class Callback
    {

        public static string OpenUrlAsync(string server, string url)
        {
            try
            {
                Thread t1 = new System.Threading.Thread
                  (() =>
                  {
                      using (WebClient wc = new WebClient())
                      {
                          try
                          {
                              string result = wc.DownloadString(server + url);
                          }
                          catch (Exception ee)
                          {
                              Console.Error.WriteLine(ee.Message);
                          }
                      }
                  });
                t1.Start();

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }

            return "done";
        }

    }
}

When I call this from ISQL it works perfectly, but when it is called from the trigger it loks like the tread gets aborted before it can make the call.

If I add t1.Join() after it is started I get the desired effect, but then it uses to much time to be called from a trigger.

Is it correct that the CLR gets “teared down” when the connection calling it is finished?

How can I make sure the thread finishes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:01:12+00:00Added an answer on June 7, 2026 at 3:01 pm

    You could wrap the Call in a SQL Anywhere Event.

    In your Table Trigger you can then use trigger event <MyEvent>

    triggers are executed within its own connection. If you have a lot of transactions you can run out of connections or overload the server. Be carefull!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following. I am trying to trigger the function based on the
I am basically trying to trigger a function if the footer is inside the
Overview: Trying to write a trigger for a SQL Server 2008 database. TableA and
I am trying to create a trigger to update another table with a condition
I am trying to automate my trigger process so that I don't have to
I am trying to trigger the Like action to a url by the visitor
I'm trying to access a value from the code behind to create a query
I am stripping url with document.location.hash and trying to check whats left behind from
I'm trying to get jQuery to take the hashtag from a URL and do
I am trying to trigger action via ajax but it doesn't call from some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.