Database Refresh

redroseredrose Member Posts: 36
Dear All,

Please tell me how can i refresh the Database from Code Unit.

My requirement is, I did some midifications in the Code Unit and i want to update the same on all client system at the same time when i save the modified code unit.Because multiple users are working in the same database.Is there any facility to update the database with recent code .(something like Refresh....etc)..Please Explain

Thanks & Regards

Rose :roll:

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    This is very simple. I am certain that all your development is done in a controlled environment and then tested on a test database. Once the testing is complete, schedule a time when the users will log off (most commonly at night) then upload the new objects. When the users log in they will now have the latest objects.
    David Singleton
  • MBergerMBerger Member Posts: 413
    THe only way to get the same result as you want is to set the object cache of all clients to 0, this way all objects will be read from the DB every time they are referenced. I won't recommend actually doing this though, because it will have a seriously impact on the performance of the application. Otherwise, the only way is to tell all your users to quit NAV and login again.
  • garakgarak Member Posts: 3,263
    Do following, like David said:

    Development Database -> Testdatabase (if ok) -> Livesystem at Night or in the morning when nobody is logged on.

    To change the Object Cache is not e good tip because the system reads ever the object table so, for example it loads ever the posting codeunits .....

    If you are under 5.01 you can create your own "Auto" Update process.

    viewtopic.php?f=5&t=27874
    Do you make it right, it works too!
  • David_SingletonDavid_Singleton Member Posts: 5,479
    MBerger wrote:
    THe only way to get the same result as you want is to set the object cache of all clients to 0, this way all objects will be read from the DB every time they are referenced. I won't recommend actually doing this though, because it will have a seriously impact on the performance of the application. Otherwise, the only way is to tell all your users to quit NAV and login again.

    [-X [-X [-X [-X [-X [-X

    Why would you do this? Sure its great to answer a persons question, but how does this help them. The OP will probably just read the first sentence and say "Ah problem solved, I will just set the cache and its fixed". People after quick fixes don't look at the implications, and don't care about the "I don't recommend" they just care about the solution.

    The ONLY solution is to work in a controlled environment and have the users log out. Sure that might change in the future with the new import object features in 2009, but not now.

    In any case setting cache to zero is EXTREMELY dangerous. Since you haven't got a clue what was changed. So there could be a sequence of code, say you open a form, that form sets some values in a table, a new form is launched from a button, there some code checks the status of those fields and runs some code. YES the objects may be refreshed, BUT only the new ones you read. So earlier down the track the status is still set with the old code. Now if you are lucky you will get an error message causing the user to quit and start again, but its also likely that you will have already run part of the old code and now part of the new code. This could be (for example) disastrous in the planning engine where there are many pieces of code called in sequence. Also many code changes require update routines. Which may or may not have run, or worse may have only partially run.

    SETTING THE CACHE TO ZERO IS NOT AN OPTION.
    David Singleton
  • redroseredrose Member Posts: 36
    Hi,


    ...SO at present ,the only solution for this is Log Out..Isn't it??


    Thanks
    Rose
  • David_SingletonDavid_Singleton Member Posts: 5,479
    redrose wrote:
    Hi,


    ...SO at present ,the only solution for this is Log Out..Isn't it??


    Thanks
    Rose

    \:D/ YES!
    David Singleton
  • SavatageSavatage Member Posts: 7,142
    It's not such a tough solution, even if you were going to go around and change everyone setting to zero - it's even easier to close & reopen the app.

    You can also restart the server :twisted: that would force then to log back in :mrgreen:
  • garakgarak Member Posts: 3,263
    Savatage wrote:
    You can also restart the server :twisted: that would force then to log back in :mrgreen:

    Why so hard, i would kill all session ;-) instead of rebooting the servermachine :-) Its faster :-D

    No, redrose, use the way that David and i recommended.
    Do you make it right, it works too!
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Why so hard ? Why bother with killing every session ?

    Just open in designer and save T98 General Ledger Setup - every user will be kicked off the system :mrgreen: :whistle: :evil:

    Regards,
    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • kapamaroukapamarou Member Posts: 1,152
    Why so hard ? Why bother with killing every session ?

    Just open in designer and save T98 General Ledger Setup - every user will be kicked off the system :mrgreen: :whistle: :evil:

    Regards,
    Slawek


    And change the object's time? :-k
  • redroseredrose Member Posts: 36
    Hi,

    Thanks a lot. =D>
    Its worked with Form but in Code unit is din't work.. ](*,)

    Please help


    Thanks & regards
    Rose
  • redroseredrose Member Posts: 36
    Hi,

    I have modified Code Unit 22,23 Function Code() but it din't reflected my modification to the other user...but in other fuctions it works as you told. #-o

    Any idea [-o<


    please Help :-k

    Thanks & Regards
    Rose
  • garakgarak Member Posts: 3,263
    redrose: the last 3 posts were ironically. :^o

    So, import the object if nobody is logged on.
    Do you make it right, it works too!
  • David_SingletonDavid_Singleton Member Posts: 5,479
    redrose wrote:
    Hi,


    ...SO at present ,the only solution for this is Log Out..Isn't it??



    Thanks
    Rose

    YES!

    Now please mark this topic as solved.
    David Singleton
Sign In or Register to comment.