Solved

Access, OLEDB and connection string

Posted on 2016-10-14
11
35 Views
Last Modified: 2016-10-20
I've inherited an app that has a connection string with :

"OLE DB Services = -4;"

I've read that this means that this will "disable OLE DB session pooling and automatic transaction enlistment".

What exactly does this mean?  Do I want this?  What are the consequences of removing it?
0
Comment
Question by:HLRosenberger
  • 4
  • 4
  • 3
11 Comments
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
ID: 41843831
Don't remove it. It is important. Connection pooling is good.

Consider connection pool as a cache of database connections maintained so that the connections can be reused when future requests to the database are required.

For more details refer blogs-

https://en.wikipedia.org/wiki/Connection_pool
http://geekexplains.blogspot.in/2008/06/what-is-connection-pooling-why-do-we.html
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41843850
but I read that having that setting disables pooling, no?   So I should remove it from the connection string, yes?
0
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
ID: 41843867
Yes you are right. It will disables OLE DB session pooling and automatic transaction enlistment.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 41843879
It may be a small distinction but there is a distinction that I think should be pointed out.

It doesn't "disable" anything.

It "enables"   "All except pooling and automatic transaction enlistment"

https://msdn.microsoft.com/en-us/library/ms724518(v=vs.85).aspx
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41843989
Got it.   Yes, so I then should remove that setting from the connection string.
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 41844010
>> so I then should remove that setting from the connection string

We cannot answer that.  We do not know what services you need or do not need.

Whenever I inherit code, I assume there is probably a pretty good reason for the previous developer to have written the code they way they did.

Granted, a few times the developer just had no idea what they were doing and all the things they did were wrong but that should be rare.

If the setting is in the code, I would suggest leaving it.

What makes you want to remove it?
0
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
ID: 41844017
Yes if it is not creating any issues with the application then why one should remove it. Let it be.

If you face any issue then you can see. Also I think the developer who has written it must have thought about it...

So leave it for now at least that what i think.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41844171
but if I leave that setting, pooling is disabled.

Why remove it?  I do not like setting thing that I don't know what they do.  I don't know why he would want to disable pooling.
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
ID: 41844189
>> I do not like setting thing that I don't know what they do.

So, if there was some large and complex formula in the code that you didn't understand, you would just delete it?

You don't know why a certain record was inserted into a certain table, just remove the insert statement?

>>but if I leave that setting, pooling is disabled.

So?  What makes you think that is a bad thing?  What makes you think it is a good thing?

>>I don't know why he would want to disable pooling.

EXACTLY, and that is why you should not just enable it.  You don't "know why" it was done in the first place.

Maybe pooling is actually OK in your system but "automatic transaction enlistment" isn't.  So removing that line will also enable that?
0
 
LVL 17

Accepted Solution

by:
Pawan Kumar Khowal earned 250 total points
ID: 41844588
I would still urge not to remove that line. Analyze the system for some time and then decide. If you face issues with that then you can go ahead and remove it.

The whole point it the developer who put that in the connection string must have though about it because people normally put only the database name, server name and few compulsory things in connection string. So thats why let leave it there only for time being.

Hope it helps.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 41852669
Thanks!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now