1. Miller Rhodes
  2. SnapObjects
  3. Tuesday, 7 January 2020 19:49 PM UTC

We have using SnapDevelop quite successfully on a project where the middle tier connects to an Oracle database.

 

I have a process that is run from an Oracle procedure that takes about 30 seconds to complete if run from within Toad or another SQL tool.

It has 2 input parameters and 2 output parameters.  When I execute it using the code below, I get a ORA-01013 error

which usually indicates a timeout.  We have our connection timeout in the connection string set to 60 secs and theis is still timing out after about 30

 

           var procedureName = "TEST_SHIP";


            var idParam = ParamValue.New<string>("I_SHO_ID", i_sho_id);
            var idParam2 = ParamValue.New<string>("I_REM_NUMBER", i_dummy_p);

            //ParamValue.New

            // The parameter 'Name' is Output type.
            var nameParam = ParamValue.New<string>("O_NOTIF_ERROR_STATUS", ParameterDirection.Output);
            var nameParam2 = ParamValue.New<string>("O_NOTIF_MESSAGE", ParameterDirection.Output);


            // Executes the SQL statement and gets the department by nameParam.
            _dataContext.SqlExecutor.ExecuteProcedure(procedureName, idParam, idParam2, nameParam, nameParam2);

            o_success_failure = nameParam.Value.ToString();

            o_message = nameParam2.Value.ToString();

 

Has anyone else run into this?  I can provide more detail if questions come in

Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 January 2020 16:27 PM UTC
  2. SnapObjects
  3. # Permalink

Hi Miller,

Have you ever modified the IDataContextOptions.CommandTimeout property when instantiating the Oracle DataContext? It's 30 by default, so please set this option to 60 and try again.

Regards, Logan

Comment
There are no comments made yet.
Miller Rhodes Accepted Answer Pending Moderation
  1. Wednesday, 8 January 2020 17:43 PM UTC
  2. SnapObjects
  3. # 1

Hi Logan.  Thank you for your response.  Is this something different than modifying the  CONNECTION TIMEOUT in the connection string ?

 Could you give me some idea of where to go to access this property ?

Comment
  1. Miller Rhodes
  2. Wednesday, 8 January 2020 18:25 PM UTC
Thanks to Logan, I figured this out. The line below solved my problem



_dataContext.ContextOptions.CommandTimeout = 60;



Here is some of our code to instantiate that



public abstract class ServiceBase : IServiceBase

{

protected readonly DbDataContext _dataContext;



protected ServiceBase(DbDataContext dataContext)

{

_dataContext = dataContext;

}
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 8 January 2020 22:06 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.