Using container managed datasource instead of hibernate ?
Hello, Today, while installing xwiki on my own box, i've found very tedious having to edit a file in a tomcat working directory (webapps/xwiki, for instance) to change the database parameters. Having a datasource defined in the container will allow admins to avoid having to learn the internals of the application, and this is how it's done in other apps like jira or confluence. For tomcat, I feel it would be better to : - make sure hibernate.cfg.xml refers to a datasource named "jdbc/XWikiDS" - define the said DataSource in $CATALINA_HOME/Catalina/localhost/xwiki.xml - put the jdbc driver in $CATALINA_HOME/common/lib, now that the container is responsible for opening the connection I think it will also ease the packaging of a standalone xwiki server. What do you think ? I'm attaching the configuration that worked for me almost out of the box. Erwan
+1 ...but the subject of your message was misleading. This is using a container managed source FOR hibernate, rather than "instead of", no? Has there been a discussion in the past of how application configuration generally is stored? Playing with installing XWiki here-and-there, I find myself missing the way SnipSnap stored configuration within the data store (XWiki, after all, already does in the XWiki space, yet some configuration is "outside" in xwiki.cfg). An option, at least, to use e.g. XWiki.ApplicationProperties would be welcome. While I'm griping about the installation process, it'd be nifty if the app "bootstrapped" by creating the DB itself when configured with an empty data store. - - - Hans Gerwitz http://phobia.com/ On Jun 22, 2005, at 8:32 AM, Erwan Arzur wrote:
Hello,
Today, while installing xwiki on my own box, i've found very tedious having to edit a file in a tomcat working directory (webapps/xwiki, for instance) to change the database parameters.
Having a datasource defined in the container will allow admins to avoid having to learn the internals of the application, and this is how it's done in other apps like jira or confluence.
For tomcat, I feel it would be better to :
- make sure hibernate.cfg.xml refers to a datasource named "jdbc/ XWikiDS" - define the said DataSource in $CATALINA_HOME/Catalina/localhost/ xwiki.xml - put the jdbc driver in $CATALINA_HOME/common/lib, now that the container is responsible for opening the connection
I think it will also ease the packaging of a standalone xwiki server.
What do you think ?
I'm attaching the configuration that worked for me almost out of the box.
Erwan
<xwiki.xml> <hibernate.cfg.xml>
-- You receive this message as a subscriber of the xwiki- dev@objectweb.org mailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/ wws
On 6/22/05, Hans Gerwitz <hans@phobia.com> wrote:
+1 ...but the subject of your message was misleading. This is using a container managed source FOR hibernate, rather than "instead of", no?
yes & no :) basically, with the current config we let hibernate create and manage the DBCP pool. Thus the "instead of", which was misleading anyway :)
Has there been a discussion in the past of how application configuration generally is stored? Playing with installing XWiki here-and-there, I find myself missing the way SnipSnap stored configuration within the data store (XWiki, after all, already does in the XWiki space, yet some configuration is "outside" in xwiki.cfg). An option, at least, to use e.g. XWiki.ApplicationProperties would be welcome.
i agree. I recently had to install atlassian's jira on xwiki.org and was really pleased with the way it is packaged and configured. You just had to edit tomcat's config to setup a container managed datasource, then use the application itself to configure it.
While I'm griping about the installation process, it'd be nifty if the app "bootstrapped" by creating the DB itself when configured with an empty data store.
I guess there is much more to do than just creating tables, a really tedious task IMHO, so i guess the developper who'll volunteer for that will get tons of karma points :) Erwan
"Erwan Arzur" <earzur@gmail.com> wrote:
I guess there is much more to do than just creating tables, a really tedious task IMHO, so i guess the developper who'll volunteer for that will get tons of karma points :)
If you're referring to populating the created tables with initial data, I've been thinking about that lately. Xwiki needs a tool to help improve multiple back-end database support. Perhaps something that could pull data out of a development snapshot database into an XML format file, and then populate the desired target database from the XML format file. There's an XML-DBMS project that might work for this purpose: http://www.rpbourret.com/xmldbms/index.htm Thoughts? Stephen
Hey, I've played around with XWiki a little while ago (apologies for vaugness, its kinda on the edge of my memory) and managed to configure it to use a datasource (as described in this thread already) with a servlet container (in this case Orion). For the database I used postgres, and on hooking the two together, all the tables where created automatically for me (I just added the db to postgres and gave it rights - no bootstrap sql files run). Because I wanted to bootstrap in some content, I just created an XWiki plugin that on the plugin's startup event checks to see if pages like Main.WebHome already exist, and if they dont copy in some template files I put in the classpath (it was a case of if none of the template files exist, create them all, if any exist, don't create any new if that makes sense).
If you're referring to populating the created tables with initial data, I've been thinking about that lately. Xwiki needs a tool to help improve multiple back-end database support. Perhaps something that could pull data out of a development snapshot database into an XML format file, and then populate the desired target database from the XML format file.
There's an XML-DBMS project that might work for this purpose:
http://www.rpbourret.com/xmldbms/index.htm For my plugin to do this I just created a load of text files with the names of the pages they where going to, and an index page. Put the whole lot in a jar, read off each page name from the index page in a loop, put each real page into xwiki using the internal XWiki API (even gets round database schema changing issues). Simple :)
For my use case this works well enough for the moment (I havn't upgraded to the latest version of the code since (well I wrote down) svn v499 (the project I was using XWiki for has been backburnered for a while), not sure how relevant it still is? Kindest regards, Tristan Allwood PS When are we really getting jsr 168 portlet compatibility? ;) -- Tristan O. R. Allwood Formicary - delivering quality financial technology solutions www.formicary.net
Jeremi is working on an XML export of the Database which already works in the XWiki interface. Next step will be to provide a Java standalone program to import.. This is already tested with HSQLDB (we have a query bug to fix which is done now), which will be the next default database we deliver with the XWiki package. This should make XWiki compatible with many databases. Ludovic Stephen Schaub a écrit :
"Erwan Arzur" <earzur@gmail.com> wrote:
I guess there is much more to do than just creating tables, a really tedious task IMHO, so i guess the developper who'll volunteer for that will get tons of karma points :)
If you're referring to populating the created tables with initial data, I've been thinking about that lately. Xwiki needs a tool to help improve multiple back-end database support. Perhaps something that could pull data out of a development snapshot database into an XML format file, and then populate the desired target database from the XML format file.
There's an XML-DBMS project that might work for this purpose:
http://www.rpbourret.com/xmldbms/index.htm
Thoughts?
Stephen
------------------------------------------------------------------------
-- You receive this message as a subscriber of the xwiki-dev@objectweb.org mailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
Hi, I am getting started on the P2P XWiki project and have few small questions. 1. I am interested in maintaining a daily activity log on Xwiki summarizing what I tried, what worked and what didn't work etc. Is there any specific area that I need to use for this specific purpose? I have created an xwiki account and a page at http://bikash.xwiki.com/xwiki/bin/view/Main/WebHome , shall I use that one (I think I read that there is a 5MB limit or so in this space). 2. How about documents/architecture designs I want to share and put up? I am going to start using http://bikash.xwiki.com/xwiki/bin/view/Main/WebHome , let me know if there is any other options. Thanks, - Bikash
On 6/23/05, Bikash Agarwalla <bikash.agarwalla@gmail.com> wrote:
Hi, I am getting started on the P2P XWiki project and have few small questions.
1. I am interested in maintaining a daily activity log on Xwiki summarizing what I tried, what worked and what didn't work etc. Is there any specific area that I need to use for this specific purpose? I have created an xwiki account and a page at http://bikash.xwiki.com/xwiki/bin/view/Main/WebHome , shall I use that one (I think I read that there is a 5MB limit or so in this space). For the moment there is no restrictions. If we limit, we can give you the right to put more data because you developp for XWiki.
2. How about documents/architecture designs I want to share and put up? You can put it on xwiki.org.
I am going to start using http://bikash.xwiki.com/xwiki/bin/view/Main/WebHome , let me know if there is any other options.
Jérémi -- ATTENTION, j'ai changé de telephone : 06.73.20.11.49 http://www.sport42.net - http://stage.xwiki.com http://www.xwiki.com - http://www.moovement.com skype: jeremi23
participants (7)
-
Bikash Agarwalla -
Erwan Arzur -
Hans Gerwitz -
jeremi joslin -
Ludovic Dubost -
Stephen Schaub -
Tristan Allwood