Re: SQL Compact Edition - Connection Pool --> Slow!
- From: "José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@xxxxxxxxxx>
- Date: Fri, 1 Jun 2007 21:35:36 +0200
Thanks for your feedback,
I have implemented it and it works really great.
-José
"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> a écrit dans le message
de news: ORWjpV8oHHA.4032@xxxxxxxxxxxxxxxxxxxxxxx
Sounds reasonable and within the scope of what SQLCe is designed to do. I
would not plan on the database to be accessible between multiple
processes, but using syncnonization or replication, your design could
scale out as well.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@xxxxxxxxxx> wrote in
message news:OyxfFa6oHHA.3948@xxxxxxxxxxxxxxxxxxxxxxx
What I will provide is really a libray that has a Read Only access to a
DB (with for sure a logic around it). Right now, it is not directly
planned to be used simultaneously by several processes (However, most
likely by several threads within a given process).
The speed is the key aspect of the the whole library. In the new thread I
started, I explained my intention and I would be happy to hear your
opinion!
Thanks,
José
"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> a écrit dans le
message de news: uxR1Ki5oHHA.4696@xxxxxxxxxxxxxxxxxxxxxxx
So, you're planning to share this database between several users?
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest
book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@xxxxxxxxxx> wrote
in message news:OUs25xvoHHA.4428@xxxxxxxxxxxxxxxxxxxxxxx
1 more question regarding this topic.
In fact, I'm writting a library application that will be used
internally within our company. I already expect it to be used by
multithreaded applications.
This was the main reason why I designed it with connection pooling in
mind ( --> get a connection, use it and release it as soon as possible
[single call pattern]).
The question I have is related to connection together with
multithreading.
In fact, to overcome the speed problem I have, I'm planning to write a
kind of "DataObjectProvider singleton Class" that will hold a set of
already initialized "db Connection".
Whenever needed, clients of this class may ask for an available
connection and when they are done, they can replace it in the pool.
Assuming, my code ensures the connections are really given back to the
singleton class when not needed anymore. Is this design valid?
Does it cause problem if different threads will query for connections
(which were created by a different thread)?
Thanks,
- José
"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> a écrit dans le
message de news: uLA9yUjoHHA.4424@xxxxxxxxxxxxxxxxxxxxxxx
Ah, it's not really necessary for the SQLCe engine. While there is
(some) justification for a pool of SQL Server connections (or other
big DBMS systems and JET) that can take some time to get fired up as
application instances come and go in an ASP application, the same
cannot be said for a SQLCe application.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest
book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@xxxxxxxxxx> wrote
in message news:usoC%23uhoHHA.3968@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for your answer.
I guess this is the way to go with compact edition.
Looking more deeply to the MSDN documentation, I found no mention
about the connection pool for Compact Edition 3.1. I just hope it
will be on the feature's list for the next release!
- José
"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxx> a écrit dans le
message de news: %23lrQeYVoHHA.596@xxxxxxxxxxxxxxxxxxxxxxx
I doubt if the SqlCe provider implements a connection pool. I
generally don't close the connection between operations to prevent
excessive compact thrashing etc.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest
book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@xxxxxxxxxx>
wrote in message news:%23UPQzrPoHHA.4124@xxxxxxxxxxxxxxxxxxxxxxx
I'm currently using the SQL Server Compact Edition 3.1 on my
Computer and I'm facing a speed problem when getting a connection
instance back from the connection Pool. Getting such a connection
actually takes ~2 ms.
I'm using the exact same connection string to get the instances
from the connection pool and only have 1 single process accessing
the pool.
Is this 2ms time considered as a normal duration to get back from
the connection pool an object that has been place back less than
10s ago?
I'm currently assuming the connection pool is enabled by default
and it is effective if you use the exact same connection string for
your instances.
Thanks,
José
.
- Follow-Ups:
- Re: SQL Compact Edition - Connection Pool --> Slow!
- From: William \(Bill\) Vaughn
- Re: SQL Compact Edition - Connection Pool --> Slow!
- Prev by Date: Re: AccessViolationException and Native Exception
- Next by Date: Re: SQL Compact Edition - connection and multi-trheading
- Previous by thread: Re: AccessViolationException and Native Exception
- Next by thread: Re: SQL Compact Edition - Connection Pool --> Slow!
- Index(es):
Relevant Pages
|