Last modified by Thomas Mortagne on 2023/10/10

From version 13.1
edited by JohannesStoldt
on 2011/01/17
Change comment: Document converted from syntax xwiki/1.0 to syntax xwiki/2.1
To version 14.3
edited by Sergiu Dumitriu
on 2011/06/07
Change comment: Added comment

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.JohannesStoldt
1 +XWiki.Sergiu
Content
... ... @@ -16,23 +16,20 @@
16 16  
17 17  == Install the JDBC driver ==
18 18  
19 -* Download the [[jtds jdbc driver>>http://jtds.sourceforge.net/]] and install the jar file into your servers lib directory (for JBoss this could be //server
20 -default
21 -lib
22 -//, for Tomcat this might be //common
23 -lib
24 -//)\
19 +* Download the [[jtds jdbc driver>>http://jtds.sourceforge.net/]] and install the jar file into your servers lib directory (for JBoss this could be //server\default\lib\//, for Tomcat this might be //common\lib\//)
25 25  
26 26  {{info}}
27 27  The connection was successfully tested with version 1.2.1 of the driver and version 1.5 of XWiki. Some problems occurred when using drivers > 1.2.1 so it might be better to use the old one.
28 28  {{/info}}
29 29  
30 -* Alternatively, you can use the [[JDBC driver provided by Microsoft>>http://www.microsoft.com/downloads/details.aspx?familyid=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en]], however this has not been thoroughly tested.
25 +* Alternatively, you can use the [[JDBC driver provided by Microsoft>>http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en]], however this has not been thoroughly tested.
31 31  
32 32  == XWiki configuration ==
33 33  
34 34  * Tell XWiki to use MSSQL. To do this, edit the //WEB-INF/hibernate.cfg.xml// file. Replace the matching properties with the following ones (or uncomment them if they are present):
35 35  
31 +=== JTDS ===
32 +
36 36  {{code language="xml"}}
37 37  <property name="connection.url">jdbc:jtds:sqlserver://<server-url>:1433/XWiki;tds=8.0;lastupdatecount=true</property>
38 38  <property name="connection.username">xwiki</property>
... ... @@ -47,6 +47,26 @@
47 47  <mapping resource="activitystream.hbm.xml"/>
48 48  {{/code}}
49 49  
47 +=== MS JDBC driver ===
48 +
49 +{{info}}
50 +Copy sqljdbc.jar from the downloaded package into //\webapps\xwiki\WEB-INF\lib\//. If you have installed Sun JRE 1.6 (or above) you need to copy **sqljdbc4.jar** instead!
51 +{{/info}}
52 +
53 +{{code language="xml"}}
54 +<property name="connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=XWiki</property>
55 +<property name="connection.username">xwiki</property>
56 +<property name="connection.password">xwiki</property>
57 +<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
58 +<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
59 +<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
60 +<property name="connection.pool_size">2</property>
61 +<property name="statement_cache.size">2</property>
62 +<mapping resource="xwiki.mssql.hbm.xml"/>
63 +<mapping resource="feeds.hbm.xml"/>
64 +<mapping resource="activitystream.hbm.xml"/>
65 +{{/code}}
66 +
50 50  == Troubleshooting ==
51 51  
52 52  === Fix search function ===
... ... @@ -59,7 +59,7 @@
59 59  
60 60  In MS SQL 2005 the standard schema in all databases is dbo by default. However, if you upgrade your server with the standard Microsoft software, all tables in your xwiki database will be configured to use a schema whichs name is equivalent to the database name. (If your database name is "xwiki", the schema name will also be "xwiki" and the full qualified tablenames will be "xwiki.xwikidoc", and so on)
61 61  
62 -Since the standard schema in is configured to be "dbo", xwiki will not find any tables (since it searches for "dbo.xwikidoc", ...). This will result in an exception when calling the xwiki webapp (in the logfiles you will see an "object not found" - exception for xwikidoc, because xwikidoc is the first table to be mapped via hibernate)\ \
79 +Since the standard schema in is configured to be "dbo", xwiki will not find any tables (since it searches for "dbo.xwikidoc", ...). This will result in an exception when calling the xwiki webapp (in the logfiles you will see an "object not found" - exception for xwikidoc, because xwikidoc is the first table to be mapped via hibernate)
63 63  There are 2 possible solutions to this problem:
64 64  
65 65  * Reconfigure your server to use "xwiki" as standard scheme inside the xwiki-database.
XWiki.XWikiComments[7]
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.wrose
Comment
... ... @@ -1,0 +1,147 @@
1 +To get XWiki 3.0 to install on SQL Server 2008, I needed to create some of the schema manually after editing the statements generated by Hibernate. The Hibernate 3.2 SQLServerDialect class is targeted to SQL Server 2000, and the SQLServer2008Dialect is not available until Hibernate 3.6.
2 +
3 +The following statements created the tables that Hibernate was generating incorrectly:(((
4 +{{code language="sql"}}
5 +create table XWIKICLASSES
6 + (
7 + XWO_ID int not null,
8 + XWO_NAME varchar(255) not null,
9 + XWO_CUSTOM_MAPPING varchar(max) null,
10 + XWO_CUSTOM_CLASS varchar(255) null,
11 + XWO_VALIDATION_SCRIPT varchar(255) null,
12 + primary key (XWO_ID)
13 + )
14 +
15 +create table XWIKICLASSESPROP
16 + (
17 + XWP_ID int not null,
18 + XWP_NAME varchar(255) not null,
19 + XWP_PRETTYNAME varchar(255) null,
20 + XWP_CLASSTYPE varchar(255) null,
21 + XWP_UNMODIFIABLE tinyint null,
22 + XWP_NUMBER int null,
23 + XWP_CUSTOMDISPLAY varchar(max) null,
24 + XWP_VALIDATION_REGEXP varchar(255) null,
25 + primary key (XWP_ID, XWP_NAME)
26 + )
27 +
28 +create table XWIKICOMMENTS
29 + (
30 + XWC_ID int not null,
31 + XWC_AUTHOR varchar(255) null,
32 + XWC_HIGHLIGHT varchar(max) null,
33 + XWC_COMMENT varchar(max) null,
34 + XWP_REPLYTO int null,
35 + XWP_DATE datetime null,
36 + primary key (XWC_ID)
37 + )
38 +
39 +create table XWIKIDOC
40 + (
41 + XWD_ID numeric(19, 0) not null,
42 + XWD_FULLNAME varchar(255) not null,
43 + XWD_NAME varchar(255) not null,
44 + XWD_TITLE varchar(255) not null,
45 + XWD_LANGUAGE varchar(5) null,
46 + XWD_DEFAULT_LANGUAGE varchar(5) null,
47 + XWD_TRANSLATION int not null,
48 + XWD_DATE datetime not null,
49 + XWD_CONTENT_UPDATE_DATE datetime not null,
50 + XWD_CREATION_DATE datetime not null,
51 + XWD_AUTHOR varchar(255) not null,
52 + XWD_CONTENT_AUTHOR varchar(255) not null,
53 + XWD_CREATOR varchar(255) not null,
54 + XWD_WEB varchar(255) not null,
55 + XWD_CONTENT varchar(max) not null,
56 + XWD_VERSION varchar(255) not null,
57 + XWD_CUSTOM_CLASS varchar(255) not null,
58 + XWD_PARENT varchar(511) not null,
59 + XWD_CLASS_XML varchar(max) null,
60 + XWD_ELEMENTS int null,
61 + XWD_DEFAULT_TEMPLATE varchar(255) not null,
62 + XWD_VALIDATION_SCRIPT varchar(255) not null,
63 + XWD_COMMENT varchar(1023) not null,
64 + XWD_MINOREDIT tinyint not null,
65 + XWD_SYNTAX_ID varchar(50) null,
66 + XWD_HIDDEN tinyint not null,
67 + primary key (XWD_ID)
68 + )
69 +
70 +create table XWIKILARGESTRINGS
71 + (
72 + XWL_ID int not null,
73 + XWL_NAME varchar(255) not null,
74 + XWL_VALUE varchar(max) null,
75 + primary key (XWL_ID, XWL_NAME)
76 + )
77 +
78 +create table XWIKIPREFERENCES
79 + (
80 + XWP_ID int not null,
81 + XWP_LANGUAGE varchar(255) null,
82 + XWP_DEFAULT_LANGUAGE varchar(255) null,
83 + XWP_MULTI_LINGUAL int null,
84 + XWP_AUTHENTICATE_EDIT int null,
85 + XWP_AUTHENTICATE_VIEW int null,
86 + XWP_AUTH_ACTIVE_CHECK int null,
87 + XWP_BACKLINKS int null,
88 + XWP_SKIN varchar(255) null,
89 + XWP_STYLESHEET varchar(255) null,
90 + XWP_STYLESHEETS varchar(255) null,
91 + XWP_EDITOR varchar(255) null,
92 + XWP_WEBCOPYRIGHT varchar(255) null,
93 + XWP_TITLE varchar(255) null,
94 + XWP_VERSION varchar(255) null,
95 + XWP_META varchar(max) null,
96 + XWP_USE_EMAIL_VERIFICATION int null,
97 + XWP_SMTP_SERVER varchar(255) null,
98 + XWP_ADMIN_EMAIL varchar(255) null,
99 + XWP_VALIDATION_EMAIL_CONTENT varchar(max) null,
100 + XWP_CONFIRMATION_EMAIL_CONTENT varchar(max) null,
101 + XWP_INVITATION_EMAIL_CONTENT varchar(max) null,
102 + XWP_LEFT_PANELS varchar(2000) null,
103 + XWP_RIGHT_PANELS varchar(2000) null,
104 + XWP_SHOW_LEFT_PANELS int null,
105 + XWP_SHOW_RIGHT_PANELS int null,
106 + XWP_LANGUAGES varchar(255) null,
107 + XWP_REGISTRATION_ANONYMOUS varchar(255) null,
108 + XWP_REGISTRATION_REGISTERED varchar(255) null,
109 + XWP_EDIT_ANONYMOUS varchar(255) null,
110 + XWP_EDIT_REGISTERED varchar(255) null,
111 + XWP_COMMENT_ANONYMOUS varchar(255) null,
112 + XWP_COMMENT_REGISTERED varchar(255) null,
113 + XWP_DOCUMENT_BUNDLES varchar(2000) null,
114 + primary key (XWP_ID)
115 + )
116 +
117 +create table XWIKISTATSREFERER
118 + (
119 + XWR_ID int not null,
120 + XWR_NUMBER int null,
121 + XWR_NAME varchar(255) not null,
122 + XWR_CLASSNAME varchar(255) not null,
123 + XWR_REFERER varchar(max) not null,
124 + XWR_PAGE_VIEWS int null,
125 + XWR_PERIOD int null,
126 + primary key (XWR_ID)
127 + )
128 +
129 +create table XWIKISTATSVISIT
130 + (
131 + XWV_ID int not null,
132 + XWV_NUMBER int null,
133 + XWV_NAME varchar(255) not null,
134 + XWV_CLASSNAME varchar(255) not null,
135 + XWV_IP varchar(255) not null,
136 + XWV_USER_AGENT varchar(max) not null,
137 + XWV_COOKIE varchar(max) not null,
138 + XWV_UNIQUE_ID varchar(255) not null,
139 + XWV_PAGE_VIEWS int null,
140 + XWV_PAGE_SAVES int null,
141 + XWV_DOWNLOADS int null,
142 + XWV_START_DATE datetime null,
143 + XWV_END_DATE datetime null,
144 + primary key (XWV_ID)
145 + )
146 +{{/code}}
147 +)))
Date
... ... @@ -1,0 +1,1 @@
1 +2011-06-07 09:57:48.0
XWiki.XWikiComments[8]
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.Sergiu
Comment
... ... @@ -1,0 +1,3 @@
1 +The good news is that 3.2 will be using Hibernate 3.6 (3.6.4 at least, we'll see if a new version will be released until the final XE 3.2).
2 +
3 +It would be very helpful if you could try to use a recent 3.2 snapshot from http://maven.xwiki.org/snapshots/org/xwiki/enterprise/xwiki-enterprise-web/3.2-SNAPSHOT/ and test how it work on MSSQL, since there have been quite a lot of changes on the storage part (hibernate + mapping). In a few minutes I'll commit some more changes for auto-creating indexes, and it would be nice to also test that indexes are correctly created when initializing the database. The build containing these changes will be available some time later today.
Date
... ... @@ -1,0 +1,1 @@
1 +2011-06-07 10:04:52.621
Reply To
... ... @@ -1,0 +1,1 @@
1 +7

Get Connected