Hi David, I had been looking at the source code of performance-meters (see xqzone) recently, and found comments that the connection pooling is being handled transparently when creating a new session object. If I am right, then this means that if you want to allow multi-threading and parallel connections to MarkLogic Server, you will have to create multiple session objects. If these session objects exist in parallel, then they will use connections that live in parallel as well. If the xmlsh process is typically executed as a single thread, then there is no need to create a new session object for each query. Each newAdhocQuery call is treated as a separate transaction anyhow (as mentioned by Danny Sokolsky in a different thread just a few hours ago ;)..
While on one hand I expect that connections in xmlsh typically prevail during the execution time, there might be use cases where a user would like to connect to two different MarkLogic servers (for purposes like synchronizing or migrating content). So I think one might prefer to specify login per connection only once, but have a means to identify different connections (sessions) at the same time. Just a thought.. Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Lee, David > Sent: dinsdag 5 mei 2009 21:04 > To: General Mark Logic Developer Discussion > Subject: [MarkLogic Dev General] Connection Caching > > I read that the ML xcc library handles "connection pooling" > .. .but does it handle "connection caching" ? > What I mean is this. > Suppose I were to do 10 XCC operations (say run newAdhocQuery). > Is there a significant advantage to reusing a session ? > Vs. creating a new session for each one. > > The context of the question ... I'm working on the ML > connector to xmlsh (www.xmlsh.org) and I'm wondering if there > is a significant advantage to complicating the API. Right > now every ML operation creates a new session (from a > connection string like "xcc://user:p...@host:port/DB") then > runs the operation. > Would there be a significant advantage to instead having a > kind of "login" method and then reusing the session instead > of creating a new one. > > Any opinions welcome ! > > -David Lee > > ---------------------------------------- > David A. Lee > Senior Principal Software Engineer > Epocrates, Inc. > [email protected] > 812-482-5224 > > > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
