留言板

Pagination in custom portlets under SQLServer 2008

thumbnail
Aritz Galdos,修改在13 年前。

Pagination in custom portlets under SQLServer 2008

Expert 帖子: 416 加入日期: 07-5-15 最近的帖子
Hi people,

We are experiencing some problems related to pagination in our portlets working against SQLServer2008.

Our custom portlets (using dynamic queries) work properly on mySql but (unfortunately) our production environments work against SQLServer (2008)

Count queries work well as far is show the correct amount of pages to navigate. But the query that should return the users from 10 to 20 or 20 to 30 and so on is always returning the first 10 users.

I am passing correctly params "begin" and "end"

Surprisingly, this error is not reproduced in Liferays porltets.

OFr more info, models where reated with service builder.

Any clue guys

Thanks a lot
thumbnail
Aritz Galdos,修改在13 年前。

RE: Pagination in custom portlets under SQLServer 2008

Expert 帖子: 416 加入日期: 07-5-15 最近的帖子
Hi,

I solved it forcing the dialect

hibernate.dialect=org.hibernate.dialect.SQLServerDialect

in portal-ext.properties

I think it was using "com.liferay.portal.dao.orm.hibernate.SQLServer2008Dialect" dialect wich overrides "org.hibernate.dialect.SQLServerDialect" for 2005 and 2008 server versions optimisations.
thumbnail
Tejas Kanani,修改在13 年前。

RE: Pagination in custom portlets under SQLServer 2008

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
Aritz Galdos:

hibernate.dialect=org.hibernate.dialect.SQLServerDialect


Hi Aritz,

We were facing the same issue. In one of the portlet, pagination is working fine in mySQL but when we move the same code on our server with MSSQL database, it's creating a problem in pagination.

I've put the property to force the hibernate dialect in portal-ext.properties and it worked.

Thanks a lot Aritz for your help.

Now what my concern is, Is it the permanent solution for the root cause ? Or it's just workaround ? Does it affect any other functionality ?
thumbnail
Aritz Galdos,修改在13 年前。

RE: Pagination in custom portlets under SQLServer 2008

Expert 帖子: 416 加入日期: 07-5-15 最近的帖子
Hi Tejas:

I guess it is fine if you use 6.0.5. Actually I did not report the incident and I don´t know if it has been solved in further versions.

You can always have a look to the classes mentioned above. I will whe I get some time.

Anyway, We are in production with this conf y it is fine.
thumbnail
Tejas Kanani,修改在12 年前。

RE: Pagination in custom portlets under SQLServer 2008

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
Hi Aritz,

It worked fine for me as well.

Thanks for your help.