2008/1/14, rssh <rssh@gradsoft.com.ua>:
On Mon, 14 Jan 2008 15:07:11 +0100, Thomas Mortagne wrote
2008/1/14, rssh <rssh@gradsoft.com.ua>:
On Mon, 14 Jan 2008 14:30:30 +0100, Thomas Mortagne wrote
No as the goal of this code is not to chose the database/schema where to works, it set the schema name to use when generating the update script for database engines based on schemas. MySQL does not need it because MySQL is based on databases.
The only place where database/schema is really changed is setDatabase() and only in non virtual mode as far as I know.
May be you mean 'only in virtual mode' ?
Yes sorry setDatabase works only in virtual mode.
Or, in such case we have:
scheme-based, non-virtual mode: patch do all work correctly. (ok) scheme-based, virtual mode: patch do all work correctly. (ok) database-based, non-virtual mode: path does not touch nothing (ok, I think) database-based, virtual mode: see below: (problem) path does not touch nothing for main database, but touch virtual databases, except case, when we call setDatabase() for main database
I tested your patch (at last) with "xwiki.db=toto" and "xwiki.virtual.db.prefix=prefix" and my results are : - mysql - virtual : change main wiki database name and correctly apply prefix (could be usefull) - non-virtual : do noting (useless) - hsqldb : - virtual : change main wiki database name and correctly apply prefix (could be usefull) - non-virtual : updateSchipt is done in toto and retrieve/save document in PUBLIC (not ok) - derby : - virtual : change main wiki database name and correctly apply prefix (could be usefull) - non-virtual : updateSchipt is done in toto and retrieve/save document in PUBLIC (not ok) - postgre : - non-virtual : do nothing (useless) - virtual : not implemented To summarize : this patch does not works with hsqldb and derby and only work in virtual mode. As I said before "table.setSchema" does not change default schema it only set schema to use in update script.
So, in XWikiHibernateBaseStore.setDatabase() for mysql we need check, that this is main database and for main database does not call getSchemaForWikiName()
Is this way looks acceptable ?
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne