Session Killer Problem

vikram7_dabasvikram7_dabas Member Posts: 611
Dear Concern
I m using Navision2009SP1 in Windows server2088 and SQL Server 2008.I have created 1 report of session killer whose Ideal time is more than 1 minute.Whenever any session is killed then it is showing me following error:

ODBC Error Occured
[Microsoft][ODBC SQL Server Driver].Optional feature not implemented State ID HSC001


Please provide me solution of not getting this error.
Vikram Dabas
Navision Technical Consultant

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Can you give some more info?

    E.g. how do you kill sessions?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • vikram7_dabasvikram7_dabas Member Posts: 611
    I have created 1 form and code written on its OnTimer Trigger and set time Interval property.Give 1 field in G/L Setup where we assign minutes that when ideal time is greater than given Time then session will be killed.When I open this form my code execute and showing above given error.
    Vikram Dabas
    Navision Technical Consultant
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You didn't answer the question. That's the way your function is triggered. That's not the way the session is killed.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Session is killed by writing code which is given below:

    If Session."Ideal Time"> GLSetup."Ideal time(minutes)" then
    Session.delete(true);

    Where,
    Session Data Dype: Record Table:Session
    Vikram Dabas
    Navision Technical Consultant
  • MalajloMalajlo Member Posts: 294
    This should work, I'm using same method on native and SQL databases.

    I'm guessing, but for your error, I think you could have problem with column (field) type. "Ideal time" or "Idle time"? "Idle" is standard field. "Ideal" your custom field?
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Dear concern
    I have changed the name of my field to Idea Time then also it is showing me same error.I m using O.S Windows server 2008 and SQL server 2008.
    Vikram Dabas
    Navision Technical Consultant
  • MalajloMalajlo Member Posts: 294
    Use existing fields. Custom field should be type of Duration.
    T:91
    Enabled	Field No.	Field Name	Data Type	Length	Description
    Yes	13031258	Idle Timeout	Duration		AX001
    
    AutoLogoff()
    users.SETFILTER(users."Idle Timeout",'<>''''') ;
    IF users.FINDFIRST THEN
      REPEAT
        Sessions.SETFILTER(Sessions."User ID",'*'+users."User ID") ;
        IF Sessions.FINDFIRST THEN
          IF Sessions."Idle Time" > users."Idle Timeout" THEN
            BEGIN 
              Sessions.DELETE ;
              MESSAGE('User %1 has been disconnected after %2.',users."User ID",users."Idle Timeout") ;
            END ;
      UNTIL users.NEXT = 0 ;
    
  • vikram7_dabasvikram7_dabas Member Posts: 611
    I have tried this code also then also it is showing me same error.
    Vikram Dabas
    Navision Technical Consultant
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    What happens if you delete a record in the session table manualy (not by code)?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • vikram7_dabasvikram7_dabas Member Posts: 611
    When I m deleting maually it is successfully deleted no error found but when using code same error found.
    Vikram Dabas
    Navision Technical Consultant
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Any Solution :-k
    Vikram Dabas
    Navision Technical Consultant
  • krikikriki Member, Moderator Posts: 9,110
    Give it a try with DELETE(FALSE) instead of DELETE(TRUE):
    recSession.DELETE(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • vikram7_dabasvikram7_dabas Member Posts: 611
    Still same error,but error has been solved by putting Commit just after delete code.I dont know how it runs.It is not showing me any error.Can u tell me logic?
    Vikram Dabas
    Navision Technical Consultant
  • krikikriki Member, Moderator Posts: 9,110
    Still same error,but error has been solved by putting Commit just after delete code.I dont know how it runs.It is not showing me any error.Can u tell me logic?
    No. I haven't the slightest idea.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.