From: Mike P. <mi...@sy...> - 2014-04-10 21:49:39
|
Definitely use the read only connection then. On 4/10/14 3:43 PM, "Jim Balhoff" <ba...@gm...> wrote: >Thank you this is really good to know. I am only querying, not updating. > >On Apr 10, 2014, at 2:34 PM, Mike Personick <mi...@sy...> wrote: > >> getConnection() tries to return the unisolated connection - this is a >> blocking operation (only one write connection to bigdata is available). >> >> If you want to support concurrent writers you should set up a queuing >> system, have writers put writes on a queue and have a single thread >> draining the queue and writing to the database. >> >> Use getReadOnlyConnection() for read-only operations - this is a >> non-blocking operation. >> >> One writer, many readers. >> >> >> >> On 4/10/14 2:28 PM, "Jim Balhoff" <ba...@gm...> wrote: >> >>> I would like to embed Bigdata within my web service application. I am a >>> little unsure of whether I'll be using it correctly and get equivalent >>> performance to queries in NanoSparqlServer. I am having trouble with >>> HTTP connections from my app to NanoSparqlServer because I generate too >>> many simultaneous connections. >>> >>> The Bigdata wiki states "The Sesame Server does not use the >>>non-blocking >>> query mode of bigdata. This can significantly limit the query >>>throughput. >>> The NanoSparqlServer andHAJournalServer both deliver non-blocking >>>query." >>> >>> I am not using the Sesame server, rather directly loading the Bigdata >>> journal into my application using Sesame like this (Scala): >>> >>> val sail = new BigdataSail(bigdataProperties) >>> val repository = new BigdataSailRepository(sail) >>> repository.initialize() >>> >>> Will this repository object be providing non-blocking query when >>> connections are opened from different web service instances (using >>> Jersey)? Is there a limit to the number of connections I can open at >>> once? Is there any problem calling the repository object from multiple >>> threads? I'm getting connections like this: >>> >>> val connection = repository.getConnection >>> connection.setAutoCommit(false) >>> val bigdataQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, >>> builtQuery.toString) >>> val result = bigdataQuery.evaluate >>> // do stuff >>> result.close() >>> connection.commit() >>> connection.close() >>> >>> Thank you, >>> Jim >>> >>> >>> >>>------------------------------------------------------------------------ >>>-- >>> ---- >>> Put Bad Developers to Shame >>> Dominate Development with Jenkins Continuous Integration >>> Continuously Automate Build, Test & Deployment >>> Start a new project now. Try Jenkins in the cloud. >>> http://p.sf.net/sfu/13600_Cloudbees >>> _______________________________________________ >>> Bigdata-developers mailing list >>> Big...@li... >>> https://lists.sourceforge.net/lists/listinfo/bigdata-developers >> > |