Jump to content

Mohammed Nasman

uniGUI Subscriber
  • Posts

    340
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by Mohammed Nasman

  1. Hello,

     

      I would like to ask if any one tried to to compile UniGui application with "LARGEADDRESSAWARE" flag, to allow the application to use up to 4GB on windows 64bit?

     

    Current application built with Delphi 2010, we are looking to upgrade to Delphi 10.1 Berlin later with 64bit support, but currently I'm trying to make it use more memory that it could use, so I need it for find if that may cause any problem?

     

    Your opining please :)

     

    Regards,

    Mohammed

  2. Activity from client? Sessions - continues. Application continues to work.

     

    No Activity? SessionTimeout starts and Application will be terminated.

     

    You are right, that's how session works, if there's no any activity session timeout will start count, any client actions, the timeout will reset.

  3. As other said, there's no right answer, but it's depend on you sitution, you should decide based on some factors for example:

     

    1. Will you host the application for all users one same physical server.?

     

    2. Will you have a replication server for the database?

     

    3. Does clients will be able to have their backup from their database?

     

    4. How many clients and tables you think you will have?

     

    5. If you have changes to database, do you consider how much effort to updates all your clients database?

     

    6. Calculate how much data will be after a year for all users, and will one database will work with this large data or it should be separated.

     

    7. Finally the backup, one backup is much easier than having hundreds backups, specially if you have a backup plan when you have full back each week and incremental back each day.

     

    Also if you consider Oracle database, it has great feature called "Virtual database", which you can have one database for all clients, but each clients will see his data only even if he uses "Select * from table"., I don't know if MS SQL server has this feature or not.

    • Upvote 1
  4. I agree with Oscar, I think the session model build from first to match the desktop systems, specially when UniGui has double compile for desktop/web for same application.

     

    elGringo, I think you should little differently with web users, if user open his application and didn't use it for hours, why he should allocate session on the server?

     

    in most web languages they have default session time for less than 30 min (asp.net 20Min, php 24 Min), I would think between 30 min and one hour is very reasonable time, otherwise if users never touch the application for longer than that time, his/her session should be terminated and this resources should be allocated for another users.

     

    also each session it allocate around 10MB as session on server, so if you have 100 active session * 10 = 1GB of server RAM, beside the allocated cache folder for each session.

  5. Hi elGringo, Glad I help to clear some things :)

     

    regarding your question regarding AllowTerminate  variable, this  will effect point 1 & 2, because it will not the let session terminate when it's reach it's time out, it's used to extend the session for another perid of time, look at OnSessionTimeout in UniGUIMainModule:

    procedure TUniMainModule.UniGUIMainModuleSessionTimeout(ASession: TObject;
      var ExtendTimeOut: Integer);
    begin
      if not AllowTerminate then
      begin
        ExtendTimeOut:=15000;  // extend session for another 15 seconds
      end;
    end;
  6. In web development sessions has two meaning:

     

    1. Session is an instance for the application with unique ID, it's for one users, for one browser (each tab on chrome has new session even if the same user is logged), each session has it's memory and events dedicate to it, and no session will see other sessions data.

     

    session usually has a timeout time (usually 20 min), and if user will be idle for this amount of time, the session will be terminated and all data (not saved) will be lost.

     

    2. Session object, it's an object dictionary for each session instance, and it could be access within the application for the same (session id only), for example you can use it as

     

    Session['MyUser'] := 'ABC', so you can read it from other pages

     

    but in UniGui you declare variables inside "TUniMainModule" and it will be access for the same users on all forms.

     

    in both cases, if session timeout (expired) all data will be lost.

  7. If UniGui has the same session management as ASP.Net, where you can use a state server that store sessions in another server that could be stored on memory or in SQL server, this make the UniGui scalable on web garden or web farms, and allow the separations of the application to multiple modules that not depend on each others, but use the same session across multiple instances or servers.

    • Upvote 1
  8. We have large VCL desktop application, when we started to add portal service for the customer, we use same source for both platforms (Desktop & web)

     

    for the DataModule I use it as following:

     

    on TUniGUIMainModule:

    type
      TMM = class(TUniGUIMainModule)
        ...
      public
       DM: TDM;
      end;
    
    .....
    
    //------------------------------------------------------------------------------
    procedure TMM.UniGUIMainModuleCreate(Sender: TObject);
    begin
     DM  := TDM.Create(UniApplication);
    

    That's make it accessible and thread safe with UniGUi.

    var
      qry :TMyQuery ;
    begin
        qry := TMyQuery.Create(nil);
      try
        qry.Connection := {$IFDEF WebApp}MM.DM{$ELSE}DM{$ENDIF}.ConEMS;
    

    and you can change the code that shared between VCL & Uni to :

     

     

     

     

    P.S. What is the RTL property on forms?

     

    It's Related to set the aligment of form and controls on it to be from Right To Left to support RTL Languages such as Arabic and Farsi.

     

     

  9. Hi Ronny,

     

      We do the same also with FastReport without any problem.

     

    @vbdavie, We do use FastReport, it's working very well as far as you don't interact with dialogs designed to be shown in VCL desktop application, such as preview windows, progress dialogs, etc.

     

    You need just to export it to PDF or HTML and show it inside browser.

     

     

    Really You just can Convert to PDF,HTML or Excel  and show in the browser 

    Example 

     

    procedure TUniMainModule.Imprimir(ReporteSalida: TppReport);
    var
      lPDFDevice: TppPDFDevice;
      CacheFileName: string;
    begin
     
      // creat and configure the PDFDevice
      lPDFDevice := TppPDFDevice.Create(nil);
      CacheFileName := UniServerModule.LocalCachePath + FormatDateTime('hhmmsszzz',
        NOW) + 'Reporte.pdf';
     
      try
        lPDFDevice.PDFSettings := ReporteSalida.PDFSettings;
        lPDFDevice.FileName := CacheFileName; // assign output stream
        lPDFDevice.Publisher := ReporteSalida.Publisher;
     
        // generate the report
     
        ReporteSalida.PrintToDevices;
        UniSession.SendFile(CacheFileName);
      finally
        lPDFDevice.Free;
      end;
     
    end;

     

×
×
  • Create New...