WCF-Sql Addapter polling issue

Hi All,
I am getting the following error when receive location is started.
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. --->
System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out at System.Data.SqlClient.SqlConnection.OnError(SqlException exception
I have set the open,close, receive time out to 10, But still I can see this issue.
Please let me know your suggestions.
Thanks in Advance. 

As the error says, SQL is not responding within the configured time or your query takes longer time to complete.
You can do the following:
Increase the timeout and see whether longer time to execute the query and waiting for the response helps.
Get the actual query being constructed/executed against SQL Server and try to execute this query in Query Analyser to see what happens.
Try to disable MSDTC in
Send Port by setting UseAmbientConnection to "false" and use "transaction
= false".  See this helps.
Check any locking related issue is blocking your query.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

Similar Messages

  • Polling records from mulitiple table(61 Tables) using WCF-SQL adapter

    Hi,
    I would like get some suggestion from this forum. I've a scenario, in which I need to poll the records from multiple table(61) which are related and may have one to many relationship. what's the best way to poll the records from SQL table to BizTalk.
    Thanks in advance..
    Regards,
    Karthick

    Karthick,
    Write a SQL stored procedure with joins from your 61 tables (!!!) . Use WCF-SQL adapter to invoke the procedures.
    Following references shall help you:
    Executing Stored Procedures in SQL Server by Using BizTalk Server
    Performing Composite Operations on SQL Server by Using BizTalk Server
    Bing-Results: biztalk wcf sql
    adapter polling stored procedure
    I don’t know your exact requirement. Consider using SQL-SSIS for ETL process depending on your requirements. Anyway if your requirement really needs BizTalk, above suggest
    should solve your problem.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • WCF-SQL Debatch and Map: Error

    I am using WCF-SQL to poll and fetch a bunch of records. I then debatch them. (Tested the output and it's ok). As a next step, I applied a map between the debatched schema and my canonical schema. Testing the map worked well. On deploying and running, I
    get an error
    "The adapter "WCF-SQL" raised an error message. Details "System.Runtime.InteropServices.COMException (0xC0C01627): Exception from HRESULT: 0xC0C01627"."
    Please advise

    Hi,
    Have you checked the Body xpath property of repeating record and checked Envelope property to true.
    I would recommend to test the Envelope Schema and document schema  through xmldasm.exe .
    Go to C:\Program Files(*)\Microsoft BizTalk server 2013\SDK\Utilities\PipelineTools copy both
    xmldasm.exe and PipelineObjects.dll to the folder where you have your schema files.
    or
     If you don't want to copy the files the alternative way is goto command prompt just type
    path = %path%;”C:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Utilities\PipelineTools” 
    hit enter.
    Open command prompt and execute the following command : xmldasm Documentxml.xml -ds
    Document.xsd -es EnvelopeSchema.xsd -c hit enter.
    Thanks
    Abhishek

  • For the property PollingStatement issue in WCF-SQL adapter

    Why i am getting below errors and finally receive port is disabled .
    Configured WC_SQl properties :
    In General tab:
    InBoundID=PODepartment
    IntialCatalog:Test
    Server: .
    First error :
    The Messaging Engine failed to add a receive location "RL_WCFCustomer" with URL "mssql://.//Test?InboundId=PODepartment" to the adapter "WCF-SQL". Reason: "Microsoft.ServiceModel.Channels.Common.AdapterException: The value
    "" for the property PollingStatement is invalid.
    Second error:
    The receive location "RL_WCFCustomer" with URL "mssql://.//Test?InboundId=PODepartment" is shutting down. Details:"The Messaging Engine failed while notifying an adapter of its configuration. ".

    After configure below properties ,getting new issue,but i don't see the schema in admin console which has mentioned in below schema related issue
    Property details
    Inbound operation type:TypedPooling
    Poll data available statement:select * from dbo.PODepartment
    Polling statement:select * from dbo.PODepartment
    Issue Details:
    There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive
    Port: "RPN_WCFCustomer" URI: "mssql://.//Test?InboundId=PODepartment" Reason: Finding the document specification by message type "http://schemas.microsoft.com/Sql/2008/05/TypedPolling/PODepartment#TypedPolling" failed. Verify
    the schema deployed properly.

  • WCF-SQL xmlpolling issue

    I have an issue with the xml im getting back from biztalk using a wcf-sql adapter.
    Im getting a strange blank namespace on a child element.
    <ShippedPackages xmlns="http://Correct.Schema">
    <Package xmlns="">
    <SALESORG>4000</SALESORG>
    <SOLDTO>5111632</SOLDTO>
    <PICKUP>5314125</PICKUP>
    <SOURCE>14</SOURCE>.....
    Im getting this blank namespace in <package>
    here are my settings for the receive location
    the receive pipeline is 'XMLreceive'
    XmlStoredProcedureRootNodeName - ShippedPackages
    XmlStoredProcedureRootNodeNamespace - http://Correct.Schema
    inbound operation type is xmlpolling
    PolledDataAvailableStatement - SELECT COUNT(*) as count FROM [Shopping].[dbo].[VW_DHLGMPartner_ShippedPackages]
    Pollingstatement - SELECT * FROM [Shopping].[dbo].[VW_DHLGMPartner_ShippedPackages] AS Package
    FOR XML AUTO, ELEMENTS
    Any ideas would be great
    Thanks

    Hi,
    Please follow the blog ->
    All about Legacy SQL Adapter and migrating it to WCF SQL Adapter
    Snippet from the blog which says:
    Issue
    Records fetched by WCF Sql Adapter have blank XMLNS with every record unlike the legacy Sql Adapter where there are no such blank namespaces coming
    along. This results in validation failure wherever the polled schema is being used as a SOURCE SCHEMA.
    Resolution
    Additionally following 2 changes need to be made: 
    Need to feed in the "PolledDataAvailableStatement" as it is a mandatory field before the polling operation could start.
    Marked "UseAmbientTransactions" as false to eliminate the error.
    For the blank namespace problems - the
    ElementFormDefault property needs to be set to 'False'.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Single detail Record repeated with xml for in wcf sql for xml polling.

    Hi,
    I am getting a weird results for a inner join of header detail with for xml auto, element.
    If I run the query in sql it gives me master detail results as expected. i.e
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>1</ID></DETAIL>
         <DETAIL><ID>2</ID></DETAIL>
    </HEADER>
    In BizTalk I configured the receive location and added a root node and the namespace to the binding properties.
    I get results as.
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>1</ID></DETAIL>
    </HEADER>
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>2</ID></DETAIL>
    </HEADER>
    Please Advice.
    Thank you and have great day! Vivek Kulkarni MCAD.net

    Hi Vivek,
    Took a while to simulate your issue. The usage of "FOR XML AUTO, ELEMENTS" is generally used in the old SQL-adapter. To get this working in the WCF-SQL adapter, you need to have some properties set which is not explored well.
    The issue is due to the way you have defined the SQL query and the "InboundOperationType" property of the WCF-SQL adapter. Here is the steps I have done to get the result as you wanted in WCF-SQL adapter, the same output as "FOR XML AUTO,
    ELEMENTS " in SQL.
    In the binding of the WCF-SQL adapter, select the  "InboundOperationType" property to "XMLPolling". The default is "Polling". 
    In the "Polling Statement", ensure the SQL statement which will give results the XML-output as you wanted. So if you have used following statement in SQL management studio, then use the same statement in the "Polling Statement" property
    of the Receive location. Ensure you DON'T remove the "For XML AUTO" statement while configuring the SQL query in receive location. As here you have choose "XMLPolling" as the value for  "InboundOperationType"
    property, the output of the SQL statement should be XML. 
    SELECT Header.ID
    ,Detail.ID
    FROM Header
    JOIN Detail ON Detail.OrderHeaderID = Header.ID
    FOR XML AUTO, ELEMENTS
    Note: You can either use SQL select statement or stored procedure. Even if any of these method used to get the resultset from SQL db, ensure it return the output in XML.
    Above query is what I have used to simulate your case, you can change it to suit your actual SQL table and column names.
    In the "PolledDataAvailableStatement" property I have used the following which would ensure that "Polling Statement" statement executes. I assume you're using this to learn how WCF-SQL adapter works, in real time you may need to update
    the query in SQL so that SQL doesn't return the resultset continuously
    SELECT top 1 Header.OrderID
    ,Detail.DetailID
    FROM Header
    JOIN Detail ON Detail.OrderHeaderID = Header.OrderID
    Try the setting, the structure of the output using the above using "XMLPolling" values in "InboundOperationType" property of the receive location binding will be same as the "FOR XML AUTO, ELEMENTS" in SQL. You may need to change
    the rootname property to suit your actual expected output.
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Polling using WCF SQL Adapter

    Hi - I have to develop this in BizTalk
    There is a table in SQL database where BizTalk needs to poll the data using WCF SQL Adapter.
    How and what query/stored proc do I need to write ?
    and how about polling interval should I mention.
    Is there any detailed blog or link which clearly explains this, will be helpful
    MBH

    The first thing that you should remember is that the most effective way of getting data from SQL would be if you could remove the records after reading them. This was something that the native SQL Server adapter supported. For WCF-SQL, the way to achieve
    this is to
    Create a SP which is what you will specify as the execute statement for your adapter. This SP would, on the basis of TOP 1, get the ID, read the record and delete it. Then it would return the read data. You will generate schemas for this SP and deploy them
    for subscribing to the received messages.
    You will create a query that returns the count of records from the said table which you will use as the polling query. This will ensure that the adapter uses this on the configured interval to see if data exists. If it exists, it would use the execute statement
    (invoking your SP) to get the data.
    There is an option to keep executing the SP while data is available. This ensures that if more than ONE record is inserted into your table, all the records would be picked up after the first polling interval (as opposed to poll, pick-up one, poll and then
    pick up the other, etc.). Be careful while setting the polling interval (you cannot go beyond 1 sec) since this depends on your SQL servers ability to process the data.
    With regards to documentation, I'd refer you to
    http://msdn.microsoft.com/en-us/library/dd788532.aspx - Polling SQL Server by using the WCF-SQL Adapter.
    Regards.

  • WCF-SQL issue

    Hi All,
    I have two Biztalk applications A & B, where I am using wcf-sql in both of them.
    In A it's working fine , But in B it's giving the following error when I start recieve location.
    WCF-SQL
    System.InvalidOperationException: TransactedBatchingBehavior validation failed. The service endpoint cannot be started. TransactedBatchingBehavior requires a binding that contains a binding element ITransactedBindingElement that returns true for ITransactedBindingElement.TransactedReceiveEnabled.
    If you are using NetMsmqBinding or MsmqIntegrationBinding make sure that ExactlyOnce is set to true. at System.ServiceModel.Description.TransactedBatchingBehavior.System.ServiceModel.Description.IEndpointBehavior.Validate(ServiceEndpoint serviceEndpoint) at
    System.ServiceModel.Description.ServiceEndpoint.Validate(Boolean runOperationValidators, Boolean isForService) at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription
    description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnBeginOpen() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan
    timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint.Enable() at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint..ctor(BizTalkEndpointContext endpointContext,
    IBTTransportProxy transportProxy, ControlledTermination control) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiver`2.AddReceiveEndpoint(String url, IPropertyBag adapterConfig, IPropertyBag bizTalkConfig)
    Please let me know your suggestions,
    Thanks in Advance.

    Hi,
    Similiar issue is discussed here
    http://social.msdn.microsoft.com/Forums/en-US/6da21689-4aaa-426f-a1c9-ae08e0e1f698/message-order-and-wcfcustom-transport-properties-dialog-box?forum=biztalkr2adapters
    Thanks,
    Deepthi

  • Wcf sql adopter issue

    i am using wcf-sql adopter ..
    Getting bellow warning..!
    WcfSendPort_SqlAdapterBinding_Procedures_DM_Custom
    mssql://sdasyapu01//CVM_Testnet_DryRun20140122_CSD?
    Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The start element with name "XSHT1841" and namespace "" was unexpected. Please ensure that your input XML conforms to the schema for the operation. Server stack trace:
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult
    result) at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
    msgData, Int32 type) at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
    any help .?
    Thanks

    You may also try below :-
    Under Metadata property, UseDatabasenameinXsdNamespace should set to 'false' in admin console.
    Also check the Namespace of your schema and ensure you are dropping the correct file.
    Thanks,
    Ashish Jain.

  • WCF-SQL Adapter Login fail 'NT AUTHORITY\ANONYMOUS LOGON

    Hi,  
    I am have three WCF-SQL receive with WCF-SQL Adapater and two are working fine but the third one is giving the following warning in the Eventlog.  Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
    I really appreciate your help.
    thanks
    Ram
    ---------------Warning written to EventLog --------------- 
    The adapter "WCF-SQL" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.AdapterException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.. Endpoint Address - mssql://txhubdb//switch_mailbox_RX2?
    ---> System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteXmlReader()
       at Microsoft.Adapters.Sql.ExecutionHelper.ExecuteXmlReader(SqlCommand sqlCommand, Double totalSeconds)
       at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.Polling_TryReceive(TimeoutHelper timeoutHelper, Message& wcfMessage)
       at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.TryReceive(TimeSpan timeout, Message& message, IInboundReply& reply)
       --- End of inner exception stack trace ---
       at Microsoft.ServiceModel.Channels.Common.Channels.AdapterInputChannel.EndTryReceive(IAsyncResult result, Message& message)
       at System.ServiceModel.Dispatcher.InputChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)".

    1) Do you have the same Credentials settings for all 3 Receive Locations (Found under Configure | Other | Credentials on you WCF-SQL Adapter)
    2) Are all 3 Receive Locations Locations polling from the same SQL Server? If not are they then on the same domain? If the server that is failing is not on the same domain as your BizTalk Host User, then you might need to supply credentials and use a local
    SQL User.
    Morten la Cour

  • WCF-SQL Adapter Hangs in Active State for hours

    I'm at a new client, and doing a simple test with a content-based-routing solution picks up a file, maps it, and is supposed to update a SQL database.  The WCF-SQL send port is stuck in the "active" state.  No messages in EventLog.  If there's
    an issue, I don't know why it doesn't just suspend.
    Any ideas?
    Thanks,
    Neal Walters

    Hi Neal,
    Few things to check IMO,
    Check if the host instance is running properly
    Check the version of the Host instance, If required make the host instance to 32 bit. 
    If it is using any schemas then make sure the binaries are deployed and gace'ed
    Try to restart the BizTalk host instance to see if it makes a difference
    Check if your SQL Database Instance is UP and running , Make sure the BizTalk service Account has proper rights on the SQL server and has execute permission on the SQL Stored procedure (if using one)
    Check if you have anything on the SQL server event viewer.
    Try to complete you routing of file using a send port also which will copy the input message to a temp folder location , Try  Using Failed Message Routing to see
    if it helps!
    There is an article
    Configuring a Port Using the WCF-SQL Adapter for further reference. 
    HTH,
    Naushad Alam
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or
    Mark As Answer
    alamnaushad.wordpress.com
    My new TechNet Wiki
    "BizTalk Server: Performance Tuning & Optimization"

  • XI adapter polling issue & JDBC  / DB2 driver connection timeout properties

    Hello Group,
    We have a long running issue with our XI 7.0 system running on iseries. (V5R3) The issue occuring is that our XI adapters stop polling and the only resolution is to restart the J2EE engine or to resart the adapter framework services.
    We have had several OSS messages open on this subject for over a year and are going round in circles with the a number of different SAP consultants.
    The one topic that we keep coming back to is that we are being asked to set DB2 driver connection timeout properties. We are using the toolbox driver and have upated to the latest JTopen driver, but have not managed to find any inofrmation on how to set the timeout parameter. Does anyone know where the timeout parameter set?
    Has anyone experienced polling issue like this before and how did you resolve?
    SAP referred to the SAP note 1078420 - XI/PI JDBC Adapter: Setting JDBC driver properties for DB which is for Oracle, but this will give an idea of what timeout parameters SAP are asking about.
    Extract of the note is below:-
    Symptom
    This note gives an option to set JDBC driver properties while acquiring a DB connection. When connecting to DB using JDBC adapter there are instances
    where DB connection take a long time to establish connection. Some times call made to Driver will hang permanently. Setting driver properties would resolve this problem.
    More Terms
    Connection timeout, time out, query timeout
    Cause and Prerequisites
    Solution
    In the advanced mode table section of sender channel and receiver channel configurations, we can set driver properties for each DB connection. Any
    such property would have to contain prefix 'driver:'(with out quotes) For example, for Oracle Database JDBC thin driver 10.2.0.3 version, the
    property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. Also for setting login time out in Oracle, we use
    oracle.net.CONNECT_TIMEOUT. To set these two properties use as follows:
    driver:oracle.jdbc.ReadTimeout 1000
    driver:oracle.net.CONNECT_TIMEOUT 1000
    (The TimeOut Driver properties like ReadTimeout and CONNECT_TIMEOUT are in milliseconds)
    Refer to your DB documentation/ JDBC driver documentation on this. Please note that properties can vary from each driver version. For instance, some
    of properties of Oracle JDBC thin Driver 10.2.0.3 properties may not be present in older version drivers. Please contact DB vendor for the complete
    list of driver properties. In addition to above, we also provide another parameter for query time out.
    sqlquerytimeout (prefix 'driver:' is not required) is the parameter that is to be used for SQL query time out. This is case-sensitive and should be
    configured as positive integer value in seconds(greater than 0).
    Any help on this would be much appreciated.
    With regards,
    Steven

    Hello,
    I am not talking about the XI timeouts. But the timeouts which can be used to get the connection timeouts for DB2/AS400 databases.
    So please provide that information.
    THanks,
    soorya

  • Use wcf-sql to call procedure

    when i use wcf-sql to call store procedure, i got problem:
    the store procedure like this:
    @variable_1 varchar(300);
    @variable_2 varchar(300);
    @variable_3 int;
    if LEN(@variable_1)<=1
    begin
         set @variable_2=0;
    end
    else
        set @variable_2=substring(@variable_1,1,LEN(@variable_1)-1); 
        set @variable_3= checksum(@variable_2);
    when the input parameter @variable_1 is empty value, it will raise two error: 1: invalid length parameter passed to the SUBSTRING function. 2: function "checksum" request at least 1 argument(s).
     it's so strange! how can i avoid this issue?

    Hi Jacky,
    Substring function can have length as positive integer only.
    SUBSTRING ( expression ,start , length )
    Length is a positive integer or bigint expression that specifies how many characters of the
    expression will be returned. If
    length is negative, an error is generated and the statement is terminated. If the sum of
    start and
    length is greater than the number of characters in
    expression, the whole value expression beginning at
    start is returned.
    Error (invalid length parameter passed to the SUBSTRING function) is result of this.
    i.e. when variable_1 = 0, length will return a negative integer.
    Error (function "checksum" request at least 1 argument(s)) is because the variable_2 is not assigned any value due to Error 1.
    Rachit
           thanks Rachit, but if @variable_1 is empty value,it should not execute
    "else" part. this is my question. how can it happen?

  • How do you configure a WCF-SQL adapter to write data from a SQL2012 "always on" database?

    Hi All,
    I have a BizTalk environment. I have to write the data from BizTalk to the database which is configured using ALWAYS ON availability group.
    I use WCF-SQL adapter to write the data. My question is this setup a supported?

    The answer is NO.
    Refer: Can
    I use a BizTalk WCF-SQL send adapter with a SQL 2012 Always on Database?
    A snippet quoted below.
    In summary (in order of preference):
    Disable AlwaysOn Availability Groups / Mirroring on SQL server if you need to connect to this SQL server which has this enabled
    Disable transactions and implement logic to be able to handle duplicates .
    Disable transactions and handle the duplicates or lost messages with custom logic (e.g. Send twice and compare and implement error handling). You need to write your own DTC handling this which
    is probably very complicated.
    Disable transactions and live with risk of duplicates or lost messages without handling duplicates.
    Refer: SQL Server AlwaysOn feature does not support MSDTC transactions.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • SQL query performance issues.

    Hi All,
    I worked on the query a month ago and the fix worked for me in test intance but failed in production. Following is the URL for the previous thread.
    SQL query performance issues.
    Following is the tkprof file.
    CURSOR_ID:76  LENGTH:2383  ADDRESS:f6b40ab0  HASH_VALUE:2459471753  OPTIMIZER_GOAL:ALL_ROWS  USER_ID:443 (APPS)
    insert into cos_temp(
    TRX_DATE, DEPT, PRODUCT_LINE, PART_NUMBER,
    CUSTOMER_NUMBER, QUANTITY_SOLD, ORDER_NUMBER,
    INVOICE_NUMBER, EXT_SALES, EXT_COS,
    GROSS_PROFIT, ACCT_DATE,
    SHIPMENT_TYPE,
    FROM_ORGANIZATION_ID,
    FROM_ORGANIZATION_CODE)
    select a.trx_date,
    g.segment5 dept,
    g.segment4 prd,
    m.segment1 part,
    d.customer_number customer,
    b.quantity_invoiced units,
    --       substr(a.sales_order,1,6) order#,
    substr(ltrim(b.interface_line_attribute1),1,10) order#,
    a.trx_number invoice,
    (b.quantity_invoiced * b.unit_selling_price) sales,
    (b.quantity_invoiced * nvl(price.operand,0)) cos,
    (b.quantity_invoiced * b.unit_selling_price) -
    (b.quantity_invoiced * nvl(price.operand,0)) profit,
    to_char(to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS'),'DD-MON-RR') acct_date,
    'DRP',
    l.ship_from_org_id,
    p.organization_code
    from   ra_customers d,
    gl_code_combinations g,
    mtl_system_items m,
    ra_cust_trx_line_gl_dist c,
    ra_customer_trx_lines b,
    ra_customer_trx_all a,
    apps.oe_order_lines l,
    apps.HR_ORGANIZATION_INFORMATION i,
    apps.MTL_INTERCOMPANY_PARAMETERS inter,
    apps.HZ_CUST_SITE_USES_ALL site,
    apps.qp_list_lines_v price,
    apps.mtl_parameters p
    where a.trx_date between to_date('2010/02/01 00:00:00','yyyy/mm/dd HH24:MI:SS')
    and to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS')+0.9999
    and   a.batch_source_id = 1001     -- Sales order shipped other OU
    and   a.complete_flag = 'Y'
    and   a.customer_trx_id = b.customer_trx_id
    and   b.customer_trx_line_id = c.customer_trx_line_id
    and   a.sold_to_customer_id = d.customer_id
    and   b.inventory_item_id = m.inventory_item_id
    and   m.organization_id
         = decode(substr(g.segment4,1,2),'01',5004,'03',5004,
         '02',5003,'00',5001,5002)
    and   nvl(m.item_type,'0') <> '111'
    and   c.code_combination_id = g.code_combination_id+0
    and   l.line_id = b.interface_line_attribute6
    and   i.organization_id = l.ship_from_org_id
    and   p.organization_id = l.ship_from_org_id
    and   i.org_information3 <> '5108'
    and   inter.ship_organization_id = i.org_information3
    and   inter.sell_organization_id = '5108'
    and   inter.customer_site_id = site.site_use_id
    and   site.price_list_id = price.list_header_id
    and   product_attr_value = to_char(m.inventory_item_id)
    call        count       cpu   elapsed         disk        query      current         rows    misses
    Parse           1      0.47      0.56           11          197            0            0         1
    Execute         1   3733.40   3739.40        34893    519962154           11          188         0
    total           2   3733.87   3739.97        34904    519962351           11          188         1
    |         Rows Row Source Operation
    | ------------ ---------------------------------------------------
    |          188 HASH JOIN (cr=519962149 pr=34889 pw=0 time=2607.35)
    |          741 .TABLE ACCESS BY INDEX ROWID QP_PRICING_ATTRIBUTES (cr=519939426 pr=34889 pw=0 time=2457.32)
    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)
    |          741 ....NESTED LOOPS (cr=50042 pr=7230 pw=0 time=11.37)
    |          741 .....NESTED LOOPS (cr=48558 pr=7229 pw=0 time=11.35)
    |          741 ......NESTED LOOPS (cr=47815 pr=7223 pw=0 time=11.32)
    |         3237 .......NESTED LOOPS (cr=41339 pr=7223 pw=0 time=12.42)
    |         3237 ........NESTED LOOPS (cr=38100 pr=7223 pw=0 time=12.39)
    |         3237 .........NESTED LOOPS (cr=28296 pr=7139 pw=0 time=12.29)
    |         1027 ..........NESTED LOOPS (cr=17656 pr=4471 pw=0 time=3.81)
    |         1027 ...........NESTED LOOPS (cr=13537 pr=4404 pw=0 time=3.30)
    |          486 ............NESTED LOOPS (cr=10873 pr=4240 pw=0 time=0.04)
    |          486 .............NESTED LOOPS (cr=10385 pr=4240 pw=0 time=0.03)
    |          486 ..............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_ALL (cr=9411 pr=4240 pw=0 time=0.02)
    |        75253 ...............INDEX RANGE SCAN RA_CUSTOMER_TRX_N5 (cr=403 pr=285 pw=0 time=0.38)
    |          486 ..............TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCOUNTS (cr=974 pr=0 pw=0 time=0.01)
    |          486 ...............INDEX UNIQUE SCAN HZ_CUST_ACCOUNTS_U1 (cr=488 pr=0 pw=0 time=0.01)
    |          486 .............INDEX UNIQUE SCAN HZ_PARTIES_U1 (cr=488 pr=0 pw=0 time=0.01)
    |         1027 ............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_LINES_ALL (cr=2664 pr=164 pw=0 time=1.95)
    |         2063 .............INDEX RANGE SCAN RA_CUSTOMER_TRX_LINES_N2 (cr=1474 pr=28 pw=0 time=0.22)
    |         1027 ...........TABLE ACCESS BY INDEX ROWID RA_CUST_TRX_LINE_GL_DIST_ALL (cr=4119 pr=67 pw=0 time=0.54)
    |         1027 ............INDEX RANGE SCAN RA_CUST_TRX_LINE_GL_DIST_N1 (cr=3092 pr=31 pw=0 time=0.20)
    |         3237 ..........TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=10640 pr=2668 pw=0 time=15.35)
    |         3237 ...........INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_U1 (cr=2062 pr=40 pw=0 time=0.33)
    |         3237 .........TABLE ACCESS BY INDEX ROWID OE_ORDER_LINES_ALL (cr=9804 pr=84 pw=0 time=0.77)
    |         3237 ..........INDEX UNIQUE SCAN OE_ORDER_LINES_U1 (cr=6476 pr=47 pw=0 time=0.43)
    |         3237 ........TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=3239 pr=0 pw=0 time=0.04)
    |         3237 .........INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=2 pr=0 pw=0 time=0.01)
    |          741 .......TABLE ACCESS BY INDEX ROWID HR_ORGANIZATION_INFORMATION (cr=6476 pr=0 pw=0 time=0.10)
    |         6474 ........INDEX RANGE SCAN HR_ORGANIZATION_INFORMATIO_FK2 (cr=3239 pr=0 pw=0 time=0.03)Please help.
    Regards
    Ashish

    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)There is no way the optimizer should choose to process that many rows using nested loops.
    Either the statistics are not up to date, the data values are skewed or you have some optimizer parameter set to none default to force index access.
    Please post explain plan and optimizer* parameter settings.

Maybe you are looking for