Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For Alexandre: Regarding Datamodules and DB components
#7
(02-10-2020, 05:24 PM)MrSpock Wrote: It may look a little ugly but until there is a proper intraweb manual, I would place all database components, database connection too, in the same form along with visual components, squeezed in the corner

I disagree here. This is not material for a manual. This is application architecture. I've read probably all old Delphi manuals and never found a word about what I just mentioned here to Soren. There is no recommendation, good practices whatsoever. Probably that's why there is so much terrible code written in Delphi out there.

This is covered by some (very few) authors. Unfortunately authors in various areas of human knowledge are people who never actually did in practice what they recommend to others. IT is no different. Several authors of Delphi from its release date in 1994/95 to mid 2000 have never actually developed a real application. Many of them worked for Borland and knew Delphi extremely well, but never created a single application using it and *more importantly* had to maintain it for years in production.

Quote:Also I do not see why database connection component should be put in the UserSession. Database connection component can have many copies for each visual form. To access database components properties you have a window in top left Delphi corner where form components are listed.

Oh... here I disagree again. There are many reasons, not only one.
Database connection is a costly thing. Both in terms of resources and performance. A new DB connection with an Oracle server takes not milliseconds but *seconds*. You can use a pool but then your "simplicity" factor above disappears.

Also, if your application allows 2 or 3 form instance to exist in memory (there are several reasons to do so) and each of them contains 1 DB connection, a single user is keeping 3 connections open with your DB server.

Now, multiply this for 1000. You have 3,000 active DB connections when you actually only need 1,000.

Have you tried to keep 3,000 active connections to a Firebird server? Your server will simply stop responding and there is nothing you can do with your IW application that will change that.
If you own the DB server you can of course use it to the limit. But if that DB server is a shared DB server. How do you explain to your customer s DBA that each active web user has 3, 4, 5... active DB connections (and possibly dozens of others in time-wait which also becomes a problem in busy enviroments)...

The list can go on and on
Reply


Messages In This Thread
RE: For Alexandre: Regarding Datamodules and DB components - by Alexandre Machado - 02-11-2020, 09:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)