Jump to content

Larry Hengen

Members
  • Content Count

    78
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Larry Hengen

  1. I have recently encountered a situation where code was explicitly setting queries to use FetchOptions.RecordCountMode := cmTotal. The query involved was rather complex and therefore expensive to execute and due to the RecordCountMode set, was being executed twice as per the FireDAC Documentation. As a result, together with all the other workload it was bringing SQL Server to it's knees. That got me thinking about what are appropriate (read least resource utilization with best performance) settings to use in the following scenarios: 1) You open a query to gather data and iterate over each record not updating the record itself but perhaps issuing other SQL Statements., or generating a report -such a query could be ReadOnly, ForwardOnly 2) You open a query with RequestLive = True and iterate over it updating values which FireDAC posts back to the database In both of the scenarios above, to display progress information you want the total record count. What do developers usually use for FireDAcC FetchMode/RecordCountMode and other settings in such scenarios and what if any combination of settings are done globally with a TFDManager vs. locally at the query level?
  2. Larry Hengen

    Best Practices for FireDAC FetchMode/RecordCount Settings

    @Hans J. Ellingsgaard I am using SQL Server. The query uses an inner join on about 5 tables, a left outer on one and a cross apply with a group by and order by on the results Pretty much a worst case scenario. Some of the criteria is not indexed, and due to the data layout requires a large # of reads. Some work has been done on the query to optimize it, and it's now better, but the question remains; what are the best settings to use for FireDAC when the cost and row count of a particular query is not generally known at design-time, as is the case with many dynamically built SQL queries.
  3. Larry Hengen

    Best Practices for FireDAC FetchMode/RecordCount Settings

    I beg to differ. The situation I encountered was that a very expensive SQL Server query wrapped in a select count(*) from() was causing major performance issues. Result set was about 1500 rows. In this case I think it's far easier to bring back the entire result set. What I was looking for was guidelines other devs are using to make such decisions since the actual row counts are not well known.
  4. Larry Hengen

    Best Practices for FireDAC FetchMode/RecordCount Settings

    That is exactly what FireDAC does for you so why would I write additional code to do the same thing? I want to avoid a second query because it can be detrimental to your SQL back end's performance. Imagine doubling it's workload for every user... A less intensive approach is to fetch all records, but that can cause a delay in processing while they are streamed to the client, and if the query is in the main thread, the application will "freeze".
  5. I experimented this weekend with deploying a small FMX app that uses a Firebird 3 database running on a Linux instance. From reading the DockWiki it doesn't seem to me that you can deploy a database file on Linux (through a VM shared drive mapping), and if you copy the database file on the linux side to the scratch folder, it is removed once you attempt to debug the application over PAServer. Is there a way to prevent PAServer from deleting files that are not part of the deployment but appear in the scratch-dir? For some reason I also cannot debug the application, I get an N8Firebird16status_exceptionE exception when attempting to open the database connection. The database file is present as I create it before the application attempts to open it. I can however, run the application from the terminal window. I assume it has something to do with permissions. PAServer is running under my user account and FireDAC is establishing a local connection to the database which is in the same folder as the app. It doesn't help using sudo to run PAServer, so I am at a loss...
  6. Larry Hengen

    Issues Deploying Firebird DB on Ubuntu 8.04LTS

    I reported this as RSP-30899 and posted on the Firebird support forums as well asking for a workaround.
  7. Larry Hengen

    Issues Deploying Firebird DB on Ubuntu 8.04LTS

    @Lars Fosdal I did try to change the database file permissions but the exception remains. The interesting thing is that I discovered the exception is not fatal. I previously assumed that once it was thrown the application could not continue. This is not the case. The application opens and does appear to behave normally. I can set a break point and debug the app, so the issue is not critical, but I would like to understand why an exception is thrown and resolve it. I have attached the DB permissions both before and after changing them. I noticed a status error opening the DB through isql about access to /tmp/Firebird so I changed the permissions on that folder. Now the exception is fatal :-). My conclusion is that I will have to post the exception on the Firebird forums for a developer to comment, or create a bug report if that doesn't work. Seems to be an installation issue of some sort. Thanks fro all the feedback.
  8. Larry Hengen

    Issues Deploying Firebird DB on Ubuntu 8.04LTS

    It's not that simple. I copied the DB to /home/larryh/Downloads/LinuxDBForCompositeTesting/COMPOSITEAPP.FDB but I get an exception (shown below) when FireDAC attempts to open the database when I am debugging. As I said, I can run the app fine from the command line, but that doesn't help me debug the app on Linux. The DB is owned by the Firebird Administrator. I have tried changing ownership to my account but that doesn't resolve the error. Project FmxTaskApp raised exception class N8Firebird16status_exceptionE with message 'Exception Object Address: 0x1C04280'.
  9. If you have an application that uses run-time packages and are supporting an older release, you cannot change the interface of any package or you have to re-distribute all dependent packages instead just the one you're updating. Is there anyway to detect interface breaking changes automatically (that it could be put on a build server)? Any advice on maintaining apps using run-time packages?
  10. Larry Hengen

    Automated Way to Detect Interface Breaking Changes

    Thanks for the response and pointing me to Dependency Walker. As for the run-time packages, it's not my choice. I was asking about best practices because I have normally been using Monolithic EXEs. Didn't realize I was already using the best practices for package based apps ;-0
  11. Larry Hengen

    Is quality.embarcadero.com down?

    It uses a the same authentication as edn.embarcadero.com which gives an error. Looks like the Oracle database is down or inaccessible: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.OracleClient.OracleException: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor at System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OracleClient.OracleConnection.Open() at EDN.Data.DbUtils.CreateConnection(ConnectionStringSettings ASettings, Boolean AOpen) at EDN.Data.DbUtils.CreateConnectionName(String AName) at MembershipWS.CDNMemberService.get_LookupSvc() at MembershipWS.CDNMemberService.GetCountryStatus(String CountryCode) --- End of inner exception stack trace I let Jim McKeeth know. Hopefully that will spur resolution.
  12. Larry Hengen

    Delphi Rio IDE hangs again and again

    I always make sure the IDE AutoSave options for both Editor and Project are enabled and find that I compile often enough to validate my changes that loss of significant work is usually not a problem.
  13. Larry Hengen

    CalDavServer and Client

    Does anyone know of a good CalDAV server and client implementation for Delphi?
  14. Larry Hengen

    CalDavServer and Client

    Thanks for the links. From what I understand the TMS Cloudpack has a Synchronization component which I will have to investigate. As for Sabre, I ran into that in my google searches but I didn't think it would work for me as it's not a Delphi solution. Will look into it's plugins further...thanks all for your suggestions.
  15. Larry Hengen

    Profiler for Delphi

    I agree the price is quite reasonable. Not crazy about the UI, but it's usable. I have been trying to use the ProDelphi 64 bit profiler against a large project using many run-time packages that has lots of code in the DPR. I am not getting the body code profiled. Any tips? I am trying to profile performance from startup to the appearance of the main form including any calls into the run-time packages.
  16. Larry Hengen

    FireDAC Change Notifications

    I was looking at the MS SQL sample project demonstrating FireDAC support for change notifications. Has anyone used this to refresh data-aware lookup combo boxes? What is the real world database overhead? How does it compare to polling? The sample project works fine, but I've noticed that if you launch multiple instances with a unique subscription name, only one gets notified of a change made in SSMS. Any idea why? I was hoping to use the sample app as a POC to help determine SQL Server overhead, and prove that all connected applications will receive change notifications. I am using Berlin 10.2 and the only bug reports seem to be for Rio.
  17. Larry Hengen

    Threading question

    If I am among the suspects I would have to disappoint. I agree that it is likely related to thread ownership of the string passed. That is why in old code you often see the use of a record type or short strings allocated in the calling thread and freed in the receiving thread. Like a flaming bag of dung thrown over a wall...up to the receiver to dispose of it.🤣
  18. Larry Hengen

    Threading question

    I suspect your problem is due to reentrancy. The code is using Windows messages to update to the UI only in the main VCL thread. This is a common old school approach prior to the use of TTHread.Synchronize(). I would venture the issue lies in the fact that Application.ProcessMessages is called in the message handler. As such it will attempt to process any pending messages in the message queue. When the load created by other threads is sufficient, there will be messages in the queue, and AVs will result as the stack variables will be overwritten. Take out the Application.ProcessMessages I would bet the AVs disappear. Calling Application.ProcessMessages is common when the main VCL thread may be very busy, but you want the UI controls to update to reflect progress. It is a CODE SMELL. If you see it, remove it. A background thread should be used for longer running tasks and these days there is no excuse for not using one because with the PPL, OTL or even just TThread it isn't that hard any more. In this case someone who didn't understand how the program works must have added the call to Application.ProcessMessages or thought it might help because the method call to write the log was taking so long. You might want to move the log writing to a background thread as well, and that would keep the entire processing headless, which is an excellent way to ensure it is testable with minimal dependencies.
  19. Larry Hengen

    Delphi Rio IDE hangs again and again

    Go to Tools - Options - select the Editor Options - Code Insight treeview item (at least this is the path in Berlin). You will then see the features I am referring to.
  20. Larry Hengen

    Delphi Rio IDE hangs again and again

    I would suggest turning off features one at a time to try to isolate the issue. It is very likely related to your code, but it doesn't mean the code is incorrect. Cyclic references can can cause issues. I would try disabling error insight, and turn off code insight or increase the delay and see if that helps.
  21. Larry Hengen

    Squint and read: CreateFormFromStings

    It is really discouraging to see the excuse that we can't fix it because it might break someone else's code...again and again. I would encourage the bug reporter to contest the "resolution" on such tickets and put comments I see here on those tickets. Without push back, there will be no change and I don't think the decision was made at a very high level. I bet @Marco wouldn't support that decision publicly.
  22. Larry Hengen

    Interface Completion

    When re-factoring code so I can introduce an interface I need to have properties implemented on the interface for compatibility to the existing implementation, so I need setters and getters to be implemented. I f I copy all the property declarations from the existing class and change the Field references to Get/Set methods, I would like to have the Delphi IDE generate the Get/Set methods the same way class completion does so for classes. Is there a way in the Delphi IDE to get Interface declarations "completed" IOW the method declarations generated in the interface? Here is some sample code to illustrate the issue: ICRSAMClient = interface(IInterface) ['{FF3CA485-A0CA-4ED6-8D70-9A757E8E9E0E}'] //property Getters/Setters function GetCRSAMData :TCRSAMDataArray; procedure SetCRSAMData(Value: TCRSAMDataArray); function GetCRSAMDataCount :integer; procedure SetCRSAMDataCount(const Value: integer); function Q22Search(Param: TCRSAMSearchParam; Threshold, RowLimit: double): boolean; property UserId: string read GetUserID write SetUserID; // User ID (authorization) property UserFirstName: string read GetUserFirstName write SetUserFirstName; // User First Name (authorization) property UserLastName: string read GetUserLastName write SetUserLastName; // User Last Name (authorization) property SendingApplication: string read GetSendingApplication write SetSendingApplication; // property SendingFacility: string read GetSendingFacility write SetSendingFacility; // property ProcessingID: string read GetProcessingID write SetProcessingID; // property Data: TCRSAMDataArray read GetCRSAMData write SetCRSAMData; // CRS returned data structure property DataCount: integer read GetCRSAMDataCount write SetCRSAMDataCount; // Data structure object count end;
  23. Larry Hengen

    Interface Completion

    @Jason Smartmuchas gracias!
  24. Larry Hengen

    Interface Completion

    @Jason Smart That is a great approach. Care to share your templates?
  25. Larry Hengen

    Interface Completion

    Yes that is exactly what I am asking. I too have traditionally used class completion on the class and then copied the Getter/Setters to the interface, but ideally the IDE limitations should not prevent you from working the way you wish too, it should facilitate most use cases. You should not have to implement an interface on a class in order to define the interface.
×