SQL executed by DLM doesn't seem to be MS-SQL friendly:
java.lang.RuntimeException: Anomaly occurred while loading structure or theme stylesheet user preferences for fragment 'Entertainment'. The fragment will not be available for inclusion into user layouts.
at org.jasig.portal.layout.dlm.FragmentActivator.loadPreferences(FragmentActivator.java:357)
at org.jasig.portal.layout.dlm.FragmentActivator.activateFragments(FragmentActivator.java:118)
at org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore$1.run(RDBMDistributedLayoutStore.java:175)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The column prefix 'ULS' does not match with a table name or alias name used in the query.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQuery(Unknown Source)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore._getStructureStylesheetUserPreferences(RDBMDistributedLayoutStore.java:1034)
at org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore.getDistributedSSUP(RDBMDistributedLayoutStore.java:841)
at org.jasig.portal.layout.dlm.FragmentActivator.loadPreferences(FragmentActivator.java:350)
... 2 more
The suspect query is:
SELECT
PARAM_NAME,
PARAM_VAL,
PARAM_TYPE,
ULS.STRUCT_ID,
CHAN_ID,
ULP.STRUCT_PARM_NM,
ULP.STRUCT_PARM_VAL
FROM UP_LAYOUT_STRUCT ULS, UP_SS_USER_ATTS UUSA
LEFT OUTER JOIN UP_LAYOUT_PARAM ULP ON UUSA.STRUCT_ID = ULP.STRUCT_ID
AND UUSA.USER_ID=4
AND UUSA.USER_ID = ULP.USER_ID
AND PROFILE_ID=1
AND SS_ID=4
AND SS_TYPE=1
AND UUSA.STRUCT_ID = ULS.STRUCT_ID
AND UUSA.USER_ID = ULS.USER_ID
AND UUSA.USER_ID = ULP.USER_ID
Focusing on this part of the above stack trace: "The column prefix 'ULS' does not match with a table name or alias name used in the query.", we attempted the following query on the database (directly, not through JDBC) which unaliases all of the references:
SELECT
UP_SS_USER_ATTS.PARAM_NAME,
UP_SS_USER_ATTS.PARAM_VAL,
UP_SS_USER_ATTS.PARAM_TYPE,
UP_LAYOUT_STRUCT.STRUCT_ID,
UP_LAYOUT_STRUCT.CHAN_ID,
UP_LAYOUT_PARAM.STRUCT_PARM_NM,
UP_LAYOUT_PARAM.STRUCT_PARM_VAL
FROM UP_LAYOUT_STRUCT, UP_SS_USER_ATTS
LEFT OUTER JOIN UP_LAYOUT_PARAM ON UP_SS_USER_ATTS.STRUCT_ID = UP_LAYOUT_PARAM.STRUCT_ID
AND UP_SS_USER_ATTS.USER_ID=4
AND UP_SS_USER_ATTS.USER_ID = UP_LAYOUT_PARAM.USER_ID
AND UP_SS_USER_ATTS.SPROFILE_ID=1
AND UP_SS_USER_ATTS.SS_ID=4
AND UP_SS_USER_ATTS.SS_TYPE=1
AND UP_SS_USER_ATTS.STRUCT_ID = UP_LAYOUT_STRUCT.STRUCT_ID
AND UP_SS_USER_ATTS.USER_ID = UP_LAYOUT_STRUCT.USER_ID
AND UP_SS_USER_ATTS.USER_ID = UP_LAYOUT_PARAM.USER_ID
However, this didn't seem to resolve the issue, we receive the message:
Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'UP_LAYOUT_STRUCT' does not match with a table name or alias name used in the query.
The UP_LAYOUT_STRUCT table is present in our database (we can select rows out of it, etc.)
Also, some output from DatabaseMetaDataImpl:
INFO [http-8080-Processor25] rdbm.DatabaseMetaDataImpl.[] Jul/11 10:54:14 - Using join test: org.jasig.portal.rdbm.DatabaseMetaDataImpl$JdbcDb
INFO [http-8080-Processor25] rdbm.DatabaseMetaDataImpl.[] Jul/11 10:54:14 - Microsoft SQL Server (Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: )
) / SQLServer (2.2.0040) database/driver
Connected To: jdbc:microsoft:
sqlserver://jhedev.nts.jhu.edu:1433;NETADDRESS=000000000000;HOSTPROCESS=0;SENDSTRINGPARAMETERSASUNICODE=true;LOGINTIMEOUT=0;DATABASENAME=uPortal;PROGRAMNAME=;SELECTMETHOD=cursor;WSID=
Supports:
Prepared Statements: true
Outer Joins: true
Transactions: true
{ts metasyntax: true
TO_DATE(): false
SELECT
PARAM_NAME,
PARAM_VAL,
PARAM_TYPE,
ULS.STRUCT_ID,
CHAN_ID,
ULP.STRUCT_PARM_NM,
ULP.STRUCT_PARM_VAL
FROM UP_LAYOUT_STRUCT ULS, UP_SS_USER_ATTS UUSA
LEFT OUTER JOIN UP_LAYOUT_PARAM ULP ON UUSA.STRUCT_ID = ULP.STRUCT_ID
AND UUSA.USER_ID=4
AND UUSA.USER_ID = ULP.USER_ID
AND PROFILE_ID=1
AND SS_ID=4
AND SS_TYPE=1
AND UUSA.STRUCT_ID = ULS.STRUCT_ID
AND UUSA.USER_ID = ULS.USER_ID
AND UUSA.USER_ID = ULP.USER_ID
returns 5250 rows from my test mysql database. is that really intended?