def open(self, writeAccess=False):
host = self.database().writeHost() if writeAccess else self.database().host()<EOL>pool = self.__pool[host]<EOL>if self.__poolSize[host] >= self.__maxSize or pool.qsize():<EOL><INDENT>if pool.qsize() == <NUM_LIT:0>:<EOL><INDENT>log.warning('<STR_LIT>')<EOL><DEDENT>return pool.get()<EOL><DEDENT>else:<EOL><INDENT>db = self.database()<EOL>event = orb.events.ConnectionEvent()<EOL>db.onPreConnect(event)<EOL>self.__poolSize[host] += <NUM_LIT:1><EOL>try:<EOL><INDENT>conn = self._open(self.database(), writeAccess=writeAccess)<EOL><DEDENT>except Exception:<EOL><INDENT>self.__poolSize[host] -= <NUM_LIT:1><EOL>raise<EOL><DEDENT>else:<EOL><INDENT>event = orb.events.ConnectionEvent(success=conn is not None, native=conn)<EOL>db.onPostConnect(event)<EOL>return conn<EOL><DEDENT><DEDENT>
Returns the sqlite database for the current thread.

:return     <variant> || None