Topic
  • 7 replies
  • Latest Post - ‏2013-08-14T14:32:08Z by RobertTanenbaum
srikanthdasari
srikanthdasari
3 Posts

Pinned topic TM1 API is giving error after TM1 Refresh

‏2013-07-01T01:45:51Z |

Hi,

I am using TM1 API in ASP.NET web application and the code is hosted in IIS.

We have a schedular which will refresh the TM1 every day, once the tm1 is refreshed, TM1 API is giving the error, once we restart the WEBSITE  and recycle the application pool in IIS it is working fine.

Is there any settings which we need to do to avoid this behaviour.

Please let me know if you need more details?

This is burning issue for us which is affecting the production environment, everytime our supports needs to restarts in IIS because of this behaviour.

 

Regards,

Srikanth Dasari

  • RobertTanenbaum
    RobertTanenbaum
    14 Posts
    ACCEPTED ANSWER

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-26T12:59:23Z  

    Did you define the TM1AdminServer instance as static?

    That would cause the connection to persist and never get taken down between database calls. So if the connection breaks because TM1 is restarted, the application would try to reuse the old connection and fail.

    If it isn't too much of a performance issue, try structuring your application so each unit of work establishes a new connection and disconnects when it is done.

    Alternatively, when you get the error in the application, try to establish a new connection and log in again. Then you won't have to recycle the application just to make a new connection. Make sure you don't get stuck in retrying the connection over and over again. If the queries are triggered by user action, just retry once and if the retry fails then report that the server is down and the user should try again later.

     

  • MarcusDietrich
    MarcusDietrich
    5 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-01T05:29:53Z  

    have you considered opening a case with IBM Support on this?

    Marcus

  • paulyoungcga
    paulyoungcga
    3 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-25T17:03:42Z  

    have you considered opening a case with IBM Support on this?

    Marcus

    It would help if you could provide more information about your errorA few follow-up questions:

    1) Which API is used (.NET, C)?
    2) Is the application on IIS disconnecting after its use?
    3) Overall more details (what is the error?) and perhaps even sharing source code might be helpful.

    The more information you can provide the more help we can provide with isolated your error.

    Thanks for all your help!

    Regards,

    Paul Young

     

  • RobertTanenbaum
    RobertTanenbaum
    14 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-26T12:59:23Z  

    Did you define the TM1AdminServer instance as static?

    That would cause the connection to persist and never get taken down between database calls. So if the connection breaks because TM1 is restarted, the application would try to reuse the old connection and fail.

    If it isn't too much of a performance issue, try structuring your application so each unit of work establishes a new connection and disconnects when it is done.

    Alternatively, when you get the error in the application, try to establish a new connection and log in again. Then you won't have to recycle the application just to make a new connection. Make sure you don't get stuck in retrying the connection over and over again. If the queries are triggered by user action, just retry once and if the retry fails then report that the server is down and the user should try again later.

     

  • srikanthdasari
    srikanthdasari
    3 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-28T23:37:05Z  

    It would help if you could provide more information about your errorA few follow-up questions:

    1) Which API is used (.NET, C)?
    2) Is the application on IIS disconnecting after its use?
    3) Overall more details (what is the error?) and perhaps even sharing source code might be helpful.

    The more information you can provide the more help we can provide with isolated your error.

    Thanks for all your help!

    Regards,

    Paul Young

     

    Hi Paul,

    Please find the details..


    1) Which API is used (.NET, C)?

    Applix TM1 API 

    C# 2.0

    2) Is the application on IIS disconnecting after its use?

    As part of the daily refresh we are running some Chores in TM1 which will copy the data from database to cubes.

    After the Chore running in TM1, application is disconnecting or showing wrong data in application side. So everytime to avoid this we needed to restart the IIS or recycle the application pool.

    3) Overall more details (what is the error?) and perhaps even sharing source code might be helpful.

    The error is "Object Refernece Error" which is pretty C# error, this is happening when we are try to get some values from cube using the Applix TM1 API.

    one more point We are using the static instances for connection opening and getting the values from cells.

    I cant share the code sorry for that.

    Updated on 2013-07-28T23:41:38Z at 2013-07-28T23:41:38Z by srikanthdasari
  • srikanthdasari
    srikanthdasari
    3 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-28T23:50:27Z  

    Did you define the TM1AdminServer instance as static?

    That would cause the connection to persist and never get taken down between database calls. So if the connection breaks because TM1 is restarted, the application would try to reuse the old connection and fail.

    If it isn't too much of a performance issue, try structuring your application so each unit of work establishes a new connection and disconnects when it is done.

    Alternatively, when you get the error in the application, try to establish a new connection and log in again. Then you won't have to recycle the application just to make a new connection. Make sure you don't get stuck in retrying the connection over and over again. If the queries are triggered by user action, just retry once and if the retry fails then report that the server is down and the user should try again later.

     

    Hi Robert..

    Yes, thats true we are using  heavy static instances in our code as below..

    public static TM1AdminServer objAdminServer;

    public static TM1Server  objServer;

    public static TM1Cube  objCube;

    public static TM1Cell  objCell;

    public static TM1Dimension objDimension;

    Is this causing the problem?

    one more strange behaviour i observed...some times it is showing the wrong values if the application connection is not disconnected. Is that possible?

  • RobertTanenbaum
    RobertTanenbaum
    14 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-07-31T16:49:38Z  

    Hi Robert..

    Yes, thats true we are using  heavy static instances in our code as below..

    public static TM1AdminServer objAdminServer;

    public static TM1Server  objServer;

    public static TM1Cube  objCube;

    public static TM1Cell  objCell;

    public static TM1Dimension objDimension;

    Is this causing the problem?

    one more strange behaviour i observed...some times it is showing the wrong values if the application connection is not disconnected. Is that possible?

    Is this causing the problem?

    The problem is most likely caused by the fact that your application establishes the connection once and then continues to use the same connection from then on, without ever taking the connection down or re-establishing the connection when it detects that the connection is no longer valid. That is why when TM1 is recycled and the connection is broken, the call to TM1 from the application fails.

    some times it is showing the wrong values if the application connection is not disconnected. Is that possible?

    This is a tough issue. It is very possible that it is also related to the fact that you are specifying static on the TM1 objects. In essence using static on a field or property in a class makes that property global to the entire application, rather than specific to the instance of the class. So if Joe uses the TM1 class and constructs a query for the Staff cube and Mary uses the TM1 class and constructs a query for the Customer cube the objCube that Joe looks at will contain customers instead of staff because objCube is defined as static. Very bad! Use static for class members or class properties ONLY when you are absolutely certain you only want ONE of these items across the entire application.

    There may be other reasons why you are getting wrong values sometimes, but definitely don't make any of these variables static. 

    Depending on where and when the TM1AdminServer and TM1Server are instantiated, making them not static might not solve your initial problem. You still might need to code some way of re-establishing the connection when TM1 is recycled. You really don't want to have to recycle IIS just to fix this problem.

  • RobertTanenbaum
    RobertTanenbaum
    14 Posts

    Re: TM1 API is giving error after TM1 Refresh

    ‏2013-08-14T14:32:08Z  

    Just for curiosity, can you post what you have done to resolve your two issues?

    1. What have you done to resolve the problem of reestablishing the connection after TM1 is cycled down and back up?
    2. What were the root causes and what have you done to resolve the problem of getting false results from your queries?