ps: your current design, combined with your locking, also contains an inherent race condition users cannot avoid.
Namely, the statements
CREATE DB dbname CLOSE
are not atomic.
As such, if a 'CREATE DB' request for the same dbname arrives in a different session before the created database was closed by the first session, that request will fail with the error I've been getting - and there's no way to avoid that in your design. You'd need a CREATE DB dbname BUT DON"T OPEN IT command to avoid it.
Just something to consider...
- Godmar