[Mulgara-general] Connections thread safe?

Alex Hall alexhall at revelytix.com
Tue Feb 26 19:32:49 UTC 2008


Are Connections in Mulgara thread-safe?  I am writing an abstraction 
layer on top of Mulgara to represent ontology models, and each "model" 
needs to have a Connection to the server that it uses to execute queries 
to get ontology metadata, list classes, etc.

Since the ConnectionFactory caches the Connections that it creates, if 
the models all share the same factory then they will wind up using the 
same Connection object.  This could possibly result in multiple, 
overlapping commands being executed on the same session from different 
threads.  Is this OK, or should I ensure that each model gets its own 
Connection instance?

Thanks,
Alex



More information about the Mulgara-general mailing list