Sorry for the English.
I mean, when building my applications, I often need to do several
database actions, and I'm thinking, what's better?
1) Open connection with DB, for instance mySQL, at beginning and close
at the end, so every "unit" in the code knows that THIS IS the
connection, and its opened.
OR
2) Every "unit" in the code opens and closes DB connection
independantly. 2 1579
3) The database object/connection is created as soon as it is needed and
passed to all units that need it. This allows reuse of the units.
Best regards
Rafi B. wrote: Sorry for the English. I mean, when building my applications, I often need to do several database actions, and I'm thinking, what's better?
1) Open connection with DB, for instance mySQL, at beginning and close at the end, so every "unit" in the code knows that THIS IS the connection, and its opened.
OR
2) Every "unit" in the code opens and closes DB connection independantly.
"Dikkie Dik" <no****@nospam.org> wrote in message
news:dq**********@news.cistron.nl... 3) The database object/connection is created as soon as it is needed and passed to all units that need it. This allows reuse of the units.
Ideally, it should use persistent connections (if the server allows), and
the object shouldn't initiate its connection to the DB unless it's passed a
query (so don't do it when the object is constructed, but when it's actually
used). Best regards
Rafi B. wrote: Sorry for the English. I mean, when building my applications, I often need to do several database actions, and I'm thinking, what's better?
1) Open connection with DB, for instance mySQL, at beginning and close at the end, so every "unit" in the code knows that THIS IS the connection, and its opened.
OR
2) Every "unit" in the code opens and closes DB connection independantly. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hung Jung Lu |
last post by:
Hi,
Does anybody know where this term comes from?
"First-class object" means "something passable as an argument in a
function call", but I fail to see the connection with "object class"
or...
|
by: Jenna Olson |
last post by:
Hi all-
I've never seen this particular issue addressed, but was wondering if
there's anything to support one way or another. Say I have a class:
class ManipulateData
{
public:...
|
by: brazilnut52 |
last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better
I have created a simple COM DLL in .NET by using the COM class...
|
by: Ryan Park |
last post by:
Hi,
//SITUATION
I got a panel control that hold a certain position on a form.
Every controls or UIs are on this panel.
At certain situation, I called dispose() method of this panel control...
|
by: Bennett Haselton |
last post by:
Is there any way to find a string representing an object's class,
which will work in Internet Explorer 6?
"typeof" doesn't work -- it returns "object" for all objects:
x =...
|
by: Steve Lutz |
last post by:
Hi All,
I have a Windows Service that runs well. The service hosts a remote object.
The purpose of the object is so that I can "peak" into the service to see
what it's doing. I wrote a small...
|
by: aaa |
last post by:
I am using a third party provider for Travel related web services. These
services are not very well documented and I am having to wing my way thru
nearly every one.
Some I can pull data from...
|
by: lars.uffmann |
last post by:
Hey everyone!
I am (still) working on a project that I took over from former
students, so don't blame me for the criminal approach on coding *g*
The problem I have is fairly easy and while I...
|
by: dotnetnovice |
last post by:
Hi everybody actually i was trying to insert some records in to SQL server through C# Wndows Aplication and during that i face an error "Object reference not set to an instance of an object." and...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |