-
Content Count
79 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Berocoder
-
My team maintains a big multiuser application. Biggest customer has about 200 users. Callstacks from exceptions is generated with JCL and logged to a text-file for each session together with other kind of loggings. Now we have idea to switch to EurekaLog instead as we have some strange random exceptions. Probably wrong memoryhandling. Any advice for a good plan for this ? Currently we have tools that parse the log-files to read exceptions and add it to a datebase. Then we can view list of most common exceptions. List of most common callstacks etc EurekaLog has its own logviewer and database but it is completely different. Not sure how well that works with the huge amount of data we have. Can we have maybe logging to both old format and new format? Comments appreciated 😊
-
Let EurekaLog send all exceptions to a database is not an bad idea. The downside is that unlike a textfile it needs a tool to red it. Or a SQL prompt... But we have already a system with log-files that contains various loggings, exceptions and callstacks. This use one log-file per running process. We are also working on a solution to log everything to one central place in Google Cloud Platform. So that might be the final solution 😊
-
Yes I agree that we have far too many exceptions. Most common ones is conflict between users. So 2 users try to update the same thing. One win and one loose. And that in turn depends on the workflow. Many users see and edit the same data. We have OSS service (Object Synchronization Service) but it can take a second or 2 before all users are notified on a change. But there is also other exceptions that actually should be fixed. But this is a separate issue. It is just that it is not realistic to create a new post in issuetracker for all exceptions. Now we read logs and create issues manually in issuetracker.
-
I can of course not say I made this as the channel header tell. My contribution is very minor. But I want to share this story anyway. And hopefully someone can use or even contribute to Bold framework. Yesterday I committed a bunch of updates to Bold for Delphi https://github.com/Embarcadero/BoldForDelphi/tree/develop History of Bold for Delphi Bold for Delphi is a Model-Driven Architecture (MDA) framework developed in the late 1990s by BoldSoft, a Swedish company. Jan Norden was one of thefounders. Bolds main focus was to enable developers to create business applications by defining the application's data structure and business rules at a higher abstraction level, rather than writing low-level code manually. In 2002, Borland acquired BoldSoft, and Bold for Delphi was included in Borland’s release of Delphi 7 Architect. This made the framework more accessible to Delphi developers and encouraged its adoption within the Delphi ecosystem. However, after Borland sold its development tools division to CodeGear. Later Embarcadero took over. Now Bold for Delphi was no longer actively developed as part of the Delphi IDE. Bold for Delphi was used in many hundreds of projects with Delphi 7. Developers was now abandoned with no support from Code/Gear/Embarcadero. But development never stopped completely. Before Borland bought Boldsoft Ahola Transport, a Finnish company bought source-code license from Boldsoft. They developed an in-house ERP application Attracs for transport business now with full access to Bolds source. Around 2010 Attracs company hired a consultant Daniel Mauric from Serbia mainly because hes deep knowledge about Bold. This turned out to be a very good move. Now the development of Bold for Delphi really gained momentum. Daniel has made countless optimizations, bug fixes but also some completely new additions to Bold. But one problem was that Bolds Intellectual Property (IP) was still hold by Embarcadero. We couldn't legally publish our changes even if we want to cooperate with other developers around the source. In May 2012 I Roland Bengtsson made a petition to release Bold with opensource license. And the petition got attention. After a while when I contacted Embarcadero we agreed on a meeting and it looks promising. But later Embarcadero changed their mind and set up unreasonable conditions like all changes with source remain Embarcaderos IP. And the years passed... Delphi product manager at Embarcadero changed to Marco Cantu. When I discussed this issue with him I noticed quickly he had a more realistic view on this. Marco realized that the only way forward was to make Bold opensource. I have no idea what happened behind the scenes but Marco convinced Embarcaderos management and published this blog 22 Sep 2020 So a big thank you to @Marco Cantu for his work! Our company now renamed to Ahola Digital continue to work with our main Bold application Attracs. Our Bold source continue to improves thanks to Daniel Mauric. These changes are now published in repository above. There is a lot more to do. Many inhouse tools and source are not commited in to repository yet. Main Purpose of Bold for Delphi The primary purpose of Bold for Delphi is to simplify the development of business applications by automating data persistence, object lifecycle management, and business rule enforcement. It emphasizes separation of concerns by letting developers focus on defining the model (business logic and rules) while the framework handles boilerplate tasks such as: Object-relational mapping (ORM) Automatic data synchronization with a database Real-time data updating in the user interface Implementation of business logic constraints and rules It essentially follows the MDA approach, where application logic is derived from the model, reducing repetitive code writing and increasing consistency across applications. Main Components of Bold for Delphi Bold Model and UML Integration: Developers define the application’s data model using UML diagrams. Rational Rose is supported but unfortunately IBM have The model is then translated into Delphi classes with associated behavior and persistence rules. Bold Business Classes: These are Delphi classes generated from the UML model. They represent the business objects, containing properties, associations, and behavior logic. Bold Object Layer: Handles the lifecycle of objects, including creation, deletion, and memory management. Ensures real-time synchronization between the application and the database. Bold Persistence Layer: Manages object persistence by mapping the Bold business classes to database tables. Abstracts database interactions, so developers don't need to write SQL manually. Bold Expression Language (OCL): A query and constraint language similar to SQL but designed for object models. Used to express rules, queries, and computed attributes in the model. Bold User Interface Components: Data-aware UI components, such as grids and editors, are bound directly to the Bold object model. Provides real-time updates as the model changes. Bold Subscription System: Ensures the UI and other dependent components react automatically when model data changes. Key Advantages of Bold for Delphi Rapid Development: Reduces repetitive coding by generating classes and managing persistence automatically. Model-Driven Approach: Ensures the application's logic and design are consistent and well-structured. Scalability: Supports complex object relationships and business rules with minimal effort. Real-Time Updates: Automatically synchronizes UI and data layers for responsive applications. Example Use Cases Bold for Delphi is particularly suited for: Enterprise resource planning (ERP) systems Customer relationship management (CRM) systems Applications with complex domain models and business rules It remains a valuable tool for Delphi developers who need to build sophisticated, model-driven applications efficiently. If you are interested to contribute or just have a question about Bold do not hesitate to ask me. I would do my best to help!
-
Delphi have a good reputation of being compatible. You can take old source code and it often compile fine in latest Delphi. My team are in the process of upgrading from 11.3 to 12.2. I have been using 12.2 for a while. When I transfer a form, pas-file and dfm-file from 12.2 to 11.3 I got this error in 11.3 So 12.2 add a new property that is unknown in 11.3. It is a pity because now I have to be careful what to commit with 12.2 to not commit these attributes by mistake.
-
Yes I understand I was wrong. Btw it was a property in a new version of Devexpress that caused this problem.
-
This error seems to be because of Developer Express upgrade. So should not blame Delphi IDE... 😁
-
New job opportunity if you are experienced. Prefered location is Kokkola Finland but remote work is accepted. https://attracs.teamtailor.com/jobs/1660578-delphi-developer/45cf12cb-1f96-4e93-94c1-8b96c6a45ade
-
I have a problem that needs to be solved. I have an application written in Delphi 10.4. It is about 10 years old. It transform data from one database to another unsing Unidac drivers. Runs on a Windows 2008 R2 Server. As it is old it needs to be replaced by a new virtual server with Windows server 2019. Unfortunately my application don't works well. It runs for a while and just quit. Not an exception no sign of error at all before it dies. At the same time we setup more strict permissions in Windows. Thought that this was the reason. When I look in eventlog I see this: Faulting application name: DatapumpOCL.exe, version: 2022.10.200.3483, time stamp: 0x6358d093 Faulting module name: KERNELBASE.dll, version: 10.0.17763.3532, time stamp: 0x95b80d84 Exception code: 0x0eedfade Fault offset: 0x00125232 Faulting process id: 0x237c Faulting application start time: 0x01d8f9bcde0671f6 Faulting application path: C:\Ahola\AholaDaily\DatapumpOCL.exe Faulting module path: C:\Windows\System32\KERNELBASE.dll Report Id: 404588fe-4a1d-45a2-8c13-42a4b0136ced Faulting package full name: Faulting package-relative application ID: This is a 32-bit application. Windows Defender is running as antivirus. But Defender seems only have information as logs. No errors. I have tried to turn off everything in Exploit Protection just for this DatapumpOCL.exe. I have tried to turn on checks for Range, Overflow and IO in Delphi compiler settings but still the same. So out of ideas now
-
I have a problem with stability in Delphi 12.2. IDE can just die without any error. The process BDS.exe is just gone and this can happen after some time like 10 to 30 minutes of working. Unfortunately my subscription ended previous month so I cannot download the latest from my.embarcadero.com but I have saved an older exe-file for installation. I can then use Getit to install the patch When installing I use the webinstaller and only install Delphi and Windows as target platform. Also Help, fonts and DUnit. Everything else is unchecked Version is now 29.0.53571.9782 Delphi 12 and C++ Builder 12 Update 2 RAD Studio 12.2 Patch 1 DevExpress 24.1.7 is also installed. I have tried reinstalled Delphi and Devexpress from scratch. I am stuck how to fix this I doubt BSD.exe itself is unstable. Host OS is Ubuntu 24.04 Delphi is running on Windows 10 Pro with KVM. This setup works fine with Delphi 11.3. So I just copied that to a new VM, uninstall 11.3 and installed 12.2. No other plugins are used for now.
-
Are the jcl and jvcl libraries still alive?
Berocoder replied to Davide Angeli's topic in Delphi Third-Party
Bit late to comment this thread... Anyway I use Starteam from Borland in the past. It was slow and not reliable. 2013 the database was corrupted so our team has to change source control system. We choosed Git and Github as that seems to be standard even at that time. SmartGit was choosen as client as none of us want to spend time to learn git commandline. Yes there was some hick ups in the beginning because we didn't understand the concept. The common solution was to delete local source folder and clone a new one from Github. Now this never happen anymore. Git is great both for small one man size projects and for big projects maintained by a team. It is simple if you are the only one that change it as there can be no conflicts. And in case your computer start burning or something you have a backup on github. In a team conflicts can occur. Often git handle that fine but if 2 people make change in same file you have to merge changes manually. -
Eventlog show Faulting application name: bds.exe, version: 29.0.53571.9782, time stamp: 0x66d2e9f2 Faulting module name: AttracsComponentsXE12Athens.bpl_unloaded, version: 1.0.0.0, time stamp: 0x6731159b Exception code: 0xc000041d Fault offset: 0x0093958c Faulting process ID: 0x2b50 Faulting application start time: 0x01db33ad2fc10672 Faulting application path: C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\bds.exe Faulting module path: AttracsComponentsXE12Athens.bpl AttracsComponentsXE12Athens.bpl is an own custom package that contain both own components and commercial we bought with source. So in this case eventlog was actually useful.
-
Thanks, will look at eventlog. But honestly Windows eventlog itself is cryptic. It has never shown any valuable information for me...
-
Normally a developer want to use async mode when send emails to make main thread more responsive. But I am in the situation to maintain an old ERP application. We use Delphi 11.3 for that. Currently it use 2 kind of email solutions. - SMTP. This contact an inhouse emailserver - SendGrid https://sendgrid.com There is now a request for a third email solution OutLook Azure from one big customer. So TMS FNC CloudPack component was bought. It was fairly easy to send emails once you get client id, secret etc correct. But the component only use asynchronous design which is correct from architecture point of view. The current code that use email method expect synchronous design. As long as emailing is working my current solution is ok. But there is no way to check and notify user in case of problem. It can be network or other reasons for error. To rewrite it require a major refactoring, that is also risky. So the most pragmatic solution would be to simulate blocking mode with FNC CloudPack if possible. So made 2 public methods in the mailing class. Send and SendWait. Send use asynchronous on places where it is possible and SendWait use synchronous. Current implementation function TATMail.SendCloudMail(const aReceiver, aReplyTo, aCc, aSubject, aBody, aAttachments: string; ACallBack: TEMailCallBack; out AErrorMessage: string): Boolean; var oOutLook: TOutlookEmail; begin oOutLook := TOutlookEmail.Create(aReceiver, aReplyTo, aCc, aSubject, aBody, aAttachments, ACallBack); if not Assigned(ACallBack) then begin while true do begin if oOutLook.Done then break; Application.ProcessMessages; end; TraceLog.Trace('After blocking'); AErrorMessage := oOutLook.fMessage; Result := oOutLook.fSuccess; end else Result := True; // Doesn't matter. None blocking code should never check result. end; I am aware that ProcessMessages is famous for cause random bugs and would prefer to no using it. I see that email component use CheckSynchronize to trigger the callback event. I tested while event.Waitfor(100) <> wrSignaled do begin CheckSynchronize(50); end; I asked similar thing on Stack overflow https://stackoverflow.com/questions/79094352/how-can-i-convert-code-to-synkron-in-delphi And @Dalija Prasnikar suggested that. But CheckSynchronize is supposed to run in the background thread not in main thread ? Could be some misunderstanding. Anyway it didn't work. So I search for a solution in main thread that cooperate well when backgroud thread is calling CheckSynchronize. There is also some code on pastebin https://pastebin.com/EXsf4ywP Only as illustration. It won't compile
-
Simulate blocking mode to send Email
Berocoder replied to Berocoder's topic in Network, Cloud and Web
@Remy Lebeau thanks for the code with WaitForMultipleObjects. I might try that later 😀 -
Simulate blocking mode to send Email
Berocoder replied to Berocoder's topic in Network, Cloud and Web
I find a solution now. I have not done much of thread-handling before Here are the modified code: function TATMail.SendCloudMail(const aReceiver, aReplyTo, aCc, aSubject, aBody, aAttachments: string; ACallBack: TEMailCallBack; out AErrorMessage: string): Boolean; var oOutLook: TOutlookEmail; begin oOutLook := TOutlookEmail.Create(aReceiver, aReplyTo, aCc, aSubject, aBody, aAttachments, ACallBack); if not Assigned(ACallBack) then begin // Simulate blocking while oOutLook.EventSignal.WaitFor(100) = wrTimeout do begin CheckSynchronize(50); end; AErrorMessage := oOutLook.fMessage; Result := oOutLook.fSuccess; end else Result := True; // Doesn't matter. None blocking code should never check result. end; I made 2 important changes 1. Call SetEvent in the event that is called by FNC mailcomponent after mail was sent. I somehow thought that this happen automatically. 2. In while loop compare with wrTimeOut instead of "<> wrSignaled". But when I think about it now maybe not so important... -
Wrote a blog today how to use interfaces to remove uses in a unit. https://berocoder.blogspot.com/.../how-to-remove... Code for project https://github.com/bero/InterFaceWithGUI
-
Hi I want to know if anyone actually can debug a Delphi console program reliable? My setup is latest Delphi 12.1 on a Window 10 running in KVM. Host is Ubuntu 24.04. Sometimes it works to singlestep source but most of the time IDE just freeze and I have to kill it🙁 I know 2 other developers with same experience as mine. I just don't understand how testing works at Embarcadero. This kinds of bugs must be catched before release! My report here https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1415
-
Sourcecode for BOLD published at GitHub
Berocoder replied to Markus Kinzler's topic in Community Management
I am a member of that team using Delphi 11.3 now if someone is interested to know more about BoldI can tell more 😊 -
Builtin Refactoring in Delphi is bad. I think we all agree that MMX Explorer works better. Have there ever been any talk with Embarcadero about use MMX Explorer instead? There is a link https://www.facebook.com/groups/137012246341854/permalink/7883294345046900/ that discuss replace builtin refactoring. Any license problems?
-
Interesting, thanks for sharing!
-
Do you need an ARM64 compiler for Windows?
Berocoder replied to Lars Fosdal's topic in Cross-platform
I assume those Delphi developers that using a Mac M1, M2 or M3 would be happy if Embarcadero would recompile Delphi IDE and compiler to Windows ARM. What is the potential problem with that ? -
Peganza and pascal expert is great products. I use them both in my daily work to ensure quality!
-
What code to you prefer and why? Alternative 1 if aMessageType = 'EXPREG' then DecodeExportReg(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPACC' then DecodeExportAcc(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPERR' then DecodeExportErr(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPREL' then DecodeExportRel(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPREF' then DecodeExportRef(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPREQ' then DecodeExportReq(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPINF' then DecodeExportInf(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPREJ' then DecodeExportRej(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPCLA' then DecodeExportCla(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPCON' then DecodeExportCon(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPAME' then DecodeExportAme(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPIRJ' then DecodeExportIrj(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPARJ' then DecodeExportArj(vDoc, aCdn, aRequestCorrelation, aMessageText) else if aMessageType = 'EXPHRT' then DecodeExportHrt(vDoc, aCdn, aRequestCorrelation, aMessageText) Alternative 2 var Index := IndexStr(aMessageType, ['EXPREG', 'EXPACC', 'EXPERR', 'EXPREL', 'EXPREF', 'EXPREQ', 'EXPINF', 'EXPCLA', 'EXPCON', 'EXPAME', 'EXPIRJ', 'EXPARJ', 'EXPHRT']); case Index of 0: DecodeExportReg(vDoc, aCdn, aRequestCorrelation, aMessageText); 1: DecodeExportAcc(vDoc, aCdn, aRequestCorrelation, aMessageText); 2: DecodeExportErr(vDoc, aCdn, aRequestCorrelation, aMessageText); 3: DecodeExportRel(vDoc, aCdn, aRequestCorrelation, aMessageText); 4: DecodeExportRef(vDoc, aCdn, aRequestCorrelation, aMessageText); 5: DecodeExportReq(vDoc, aCdn, aRequestCorrelation, aMessageText); 6: DecodeExportInf(vDoc, aCdn, aRequestCorrelation, aMessageText); 7: DecodeExportRej(vDoc, aCdn, aRequestCorrelation, aMessageText); 8: DecodeExportCla(vDoc, aCdn, aRequestCorrelation, aMessageText); 9: DecodeExportCon(vDoc, aCdn, aRequestCorrelation, aMessageText); 10: DecodeExportAme(vDoc, aCdn, aRequestCorrelation, aMessageText); 11: DecodeExportIrj(vDoc, aCdn, aRequestCorrelation, aMessageText); 12: DecodeExportArj(vDoc, aCdn, aRequestCorrelation, aMessageText); 13: DecodeExportHrt(vDoc, aCdn, aRequestCorrelation, aMessageText); end; Regards Roland Bengtsson
-
In our big ERP application we have always compiled it with Optimization off in compiler settings to production. Delphi 10.4 is used but plan is to switch to 11.3 during summer. With our biggest customer the volumes has increased and the application can sometimes feel slow. So I tried to compile it with Optimization on as that is a cheap way to increase performance. Everything seems to work fine. But there is one thing. Exceptions are logged to a textfile. Callstack/Stacktrace are also logged. We use JCL for that. It works fine before but now I see sometimes callstacks make no sense anymore. Obviously I suspect Optimization for that. So curious how other developers handle this case ? Is there other components like EurekaLog that handle optimization better and still can generate a reliable callstack ? Or maybe we have to choose between better performance or reliable callstack ? Regards Roland Bengtsson