On Thu, 20 Mar 2008 20:11:23 +0500, Artem Melentyev wrote
Hi.
Some remarks:
I think !"".equals(s) is better than s.length()!=0 because more
semantic and easy to read. What is "xwiki.dv" config option? (what
does "dv" mean?). I think we need more meaningful params than
"xwiki.db" and "xwiki.dv"
Хmm, it's xwiki.dv in patch ?
Ohh, it's must be xwiki.db as in my working copy.
(something like xwiki.db.mainname, xwiki.db.forceset
?)
Why we need to force setDatabase in non virtual mode?
Because we want set name of database. It is what this patch must do.
I'm afraid this answer is not ideall for you. May be next sentence help: it
is impossible to set database in hibernate in other way, than do all
functionality, which is in 'setDatabase()'
[Alternative is rewrite configuration part of hibernate]
Is it only for fix security issues?
Let's imagine that we does not call setDatabase
in this case setting database will be possible via next procedure:
-- change name in hibernate config
-- set same name to xwiki.db (to call updateSchema with correct database)
(and yes, it can be insecure)
With call of setDatabase we
a) does not require from user to change hibernate config.
b) prevent call of setDatabase from user code. (security)
Note, that only change name in hibernate config is incorrect and in general
will not work, because updateScheme in some cases will generate full name of
tables (with schema part) which we can't deduce and can't get from hibernate.
Thomas Mortagne wrote:
Hi all,
I would like the point of view of every ones for the patch provided in
http://jira.xwiki.org/jira/browse/XWIKI-2006 by Ruslan Shevchenko
(configurated_db_schema_06.patch).
It allows to force the name of the database in the xwiki.cfg file.
Except for some very minor Checkstyle still remaining, the only
"problem" for me is than if this feature is enabled the number of
hibernates query in non-virtual mode grows to one more by hibernate
transaction used to ensure the selected database is the provided one.
Note that this is not worst than actual virtual mode which do almost
exactly the same thing for the same reason.
For that reason and also because it touch one of the deepest part of
XWiki platform I want to validate a vote to apply it in the trunk.
It also add database names prefix support which is great.
Here my +1.
--
Artem Melentyev
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Ruslan Shevchenko
GradSoft.
http://www.gradsoft.ua