[JBoss Seam] - EntityQuery.nextExists not working correctly?
by azalea
Hi,
I'm new in JBoss Seam and reading Yuan's Seam Book.
I want to display multipage query results with EntityQuery(Seam CRUD App Framework).
I want to display 3 data records(EntityQuery#getMaxResults) per page, and now there are 6 data records in database table.
Then there are "Next Page" and "Last Page" links in first page. That's OK.
But there are also in second page! (i.e. #{fans.nextExists) returns true regardless of no next data records)
When I click "Next Page" or "Last Page" link in second page, third page is displayed without data records( and next/last paging links).
Why "Next/Last Page" links are displayed in second page regardless of no next data records?
| <s:link view="/fans.xhtml"
| rendered="#{fans.previousExists}"
| value="#{messages.left}#{messages.left} First Page"
| id="firstPage">
| <f:param name="firstResult" value="0"/>
| </s:link>
|
| <s:link view="/fans.xhtml"
| rendered="#{fans.previousExists}"
| value="#{messages.left} Previous Page"
| id="previousPage">
| <f:param name="firstResult"
| value="#{fans.previousFirstResult}"/>
| </s:link>
|
| <s:link view="/fans.xhtml"
| rendered="#{fans.nextExists}"
| value="Next Page #{messages.right}"
| id="nextPage">
| <f:param name="firstResult"
| value="#{fans.nextFirstResult}"/>
| </s:link>
|
| <s:link view="/fans.xhtml"
| rendered="#{fans.nextExists}"
| value="Last Page #{messages.right}#{messages.right}"
| id="lastPage">
| <f:param name="firstResult"
| value="#{fans.lastFirstResult}"/>
| </s:link>
|
| @Name("fans")
| public class PersonList extends EntityQuery {
| ......
|
| @Override
| public String getEjbql() {
| return "select p from Person p";
| }
|
|
| @Override
| public Integer getMaxResults() {
| return 3;
| }
|
| ......
| }
|
[environment]
JBoss AS 4.0.5.GA( & HSQLDB)
JBoss Seam 1.2.1.GA
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049604#4049604
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049604
18 years, 10 months
[Installation, Configuration & Deployment] - 4.0.1sp1 upgrade to 4.2.0GA with webapp using Hibernate 3.0.
by khooke
I have a webapp that I've been running on JBoss 4.0.1sp1 (and prior versions) for a couple of years - the war is self contained and is using Hibernate 3.0.5.
Deploying this same webapp to 4.2.0GA I get exceptions when the SessionFactory tries to initialize:
| 2007-05-29 23:46:53,203 ERROR [STDERR] java.lang.ClassCastException: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate
| 2007-05-29 23:46:53,204 ERROR [STDERR] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
| 2007-05-29 23:46:53,204 ERROR [STDERR] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:270)
| 2007-05-29 23:46:53,204 ERROR [STDERR] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
|
The lines in my hibernate.cfg.xml file related to the Transaction Manager look like this:
| <property name="connection.datasource">java:/datasourcename</property>
| <property name="show_sql">true</property>
| <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
| <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
| <property name="hibernate.transaction.manager_lookup_class">
| org.hibernate.transaction.JBossTransactionManagerLookup</property>
|
And my datasource configuration looks like this:
| <datasources>
| <local-tx-datasource>
| <jndi-name>datasourcename</jndi-name>
| <connection-url>jdbc:mysql://localhost/databasename</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>user</user-name>
| <password>password</password>
| </local-tx-datasource>
|
| </datasources>
|
|
I gather the Transaction Manager in 4.2 is now different. Do I have to configure something different, either in my datasource or my hibernate config?
Thanks, Kevin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049602#4049602
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049602
18 years, 10 months