I've a web server and a separate SQL server. I'm trying to use transaction scope to ensure that SQL queries are completed with my linq queries.
I wrap everything with this
using (TransactionScope scope = new TransactionScope())
I want to know where I need to install DTC. Do I need to install it on the IIS 7.5 box AND the SQL server? Do I need to unblock some ports? Are there any security risk in doing so?
I've setup this up once before but don't remember how. If I can't get access to DTC then is there any other way to ensure a lINQ and sql query is atomic?
I believe that this is a duplicate of Where MSDTC needs to be installed and configured.
The answer is at both endpoints participating in the transaction, but the security is such that one is outbound and the other is inbound.
Related
In a SQL Server Managed Instance I have 2 databases (for security reasons both databases have different logins). I need the possibility to allow one database to look into the other one. In a local SQL Server I was able to create a Linked Server to realize this. But this seems not to work using the Managed Instance.
Can someone give some hints how to achieve this?
Managed Instance supports linked servers (unless if they use MSDTC for some distributed writes). Make sure that you add logins for remote server:
EXEC master.dbo.sp_addlinkedsrvlogin #rmtsrvname=N'PEER',#useself=N'False',#locallogin=NULL,
#rmtuser=N'$(linkedServerUsername)', #rmtpassword='$(linkedServerPassword)';
If it still doesn't work put the exact error message. This might be Network security Group blocking the port, VNets that are not peered, etc.
We had issue during connection from BT to staging DB ( it has setup under AG listeners) and couldn’t able to enable RL and SP because by default WCF Custom sql bindings set “multisubnetfailover” to true.
Is there any work around to use AG listeners on Biztalk sql connection string without disable “multisubnetfailover” property to “False” ?
No.
From High Availability using SQL Server Always On Availability Groups - BizTalk Server
Support Availability Group Multi-Subnet Failovers
BizTalk Server uses Microsoft OLE DB for database connections, which does not support the MultiSubnetFailover connection option. BizTalk Server does not support the MultiSubnetFailover (=TRUE) connection option, and this may cause higher recovery time during multi-subnet failover.
Note: Although the above documentation has not been updated to state it, BizTalk 2020 may allow this for that adapters. See MultiSubnetFailover connection option in BizTalk.
I am working on a client-server application and using LINQ to SQL to perform databases operations, 1 databases is on server and multiple clients will connect to it and there will be sync of databases records as well, Trying to manage a transaction with multiple datacontext and multiple databases but getting error on MSDTC service that it is not configured, before I go to configure I want to ask Is the MSDTC the only option? It will not be available in shared hosting then what type of hosting i should be looking for?
Any other thing I need to check before I go to MSDTC configuration? Is this service required only on server or must be configured on each client machine?
I have developed a web application where in i've configured two <Resource> with proper parameters in server.xml of Apache tomcat server, Using JNDI connection pool. Among two resource tags in server.xml, first tag is having details of primary server and another tag contains the details of standby server. My idea is if i dont get connection from primary for certain time, I'll switch the datasource to standby and run the query from servlet. But when I ran the code, It gave me the error Cannot create PoolableConnectionFactory (DB2 SQL Error: SQLCODE=-1776, SQLSTATE= , SQLERRMC=1, DRIVER=3.57.82)
I googled lot but cant find any concrete answer about this, but one thing was common in all i.e. HADR(Hisgh Availability Disaster Recovery) configuration of DB2 server.
Please help me out.
Generally speaking, you cannot connect to the standby database unless it assumes the primary role after the take-over.
The correct way of setting up a DB2 HADR cluster is to configure a virtual IP address in your cluster management software that gets assigned to the new primary database after the take-over; while the change remains completely transparent for client applications.
You'll need to talk to your DBAs to learn how to configure the application.
In a HADR configuration, each time the database flips from primary to standby and the standby to primary, the Server will send ClientReroute Exception to each client connected to DB2 server, So I've caught it programtically and and tried the transaction again and it succeeded.
I have an ASP application sitting on 2 servers, using a db in SQL Server 2012. The SQL Server uses AlwaysOn Availability groups but when these failover the client connecting to the ASP.NET application terminates. I have looked into the SQL driver which as it turns out the app is using SqlClasses so not using ODBC driver (from what I have deduced I presume that logic is sound but correct me if I'm wrong).
Another suggestion has been made that I load balance the 2 app servers and that will seamlessly allow failover underneath without the client loosing connection, is this a viable way to go? We don't have much control over the applications code to ask it to try the connection again after failing....
Many thanks in advance.
Try defining the failover partner in your connection string.
Data Source=myServerAddress;Failover Partner=myMirrorServerAddress;
Initial Catalog=myDataBase;Integrated Security=True;
And also check out MultiSubNetFailover property in .NET 4.5