Foren

Pagination in custom portlets under SQLServer 2008

thumbnail
Aritz Galdos, geändert vor 13 Jahren.

Pagination in custom portlets under SQLServer 2008

Expert Beiträge: 416 Beitrittsdatum: 15.05.07 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Pagination in custom portlets under SQLServer 2008

Expert Beiträge: 416 Beitrittsdatum: 15.05.07 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Pagination in custom portlets under SQLServer 2008

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Pagination in custom portlets under SQLServer 2008

Expert Beiträge: 416 Beitrittsdatum: 15.05.07 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Pagination in custom portlets under SQLServer 2008

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Hi Aritz,

It worked fine for me as well.

Thanks for your help.