[JBoss Seam] - Can't load the data from the view
by Seto
I just coded as the example dvdstore, I'm cofused about loading the data from the view. In the view #{rs==null} return true. Does it need some other codes or settings to load the data ignored in the example?
| /**
| *
| */
| package cn.net.kdc.action.cms;
|
| import java.util.*;
| import javax.ejb.*;
| import javax.persistence.*;
|
| import org.jboss.seam.*;
| import org.jboss.seam.annotations.*;
| import org.jboss.seam.annotations.datamodel.*;
|
| import cn.net.kdc.domain.global.*;
|
| /**
| * @author Seto
| *
| */
| @Stateful
| @Name("haha")
| @Scope(ScopeType.SESSION)
| public class Haha implements IHaha {
| @PersistenceContext
| private EntityManager entityManager;
|
| @DataModel
| List rs;
|
| public String getTest() {
| return entityManager.find(Resource.class, 1).getTag();
| }
|
| public String getMm(){
| return ((Resource)rs.get(0)).getTag();
| }
|
| @Factory("rs")
| public void gets(){
| rs = entityManager.createQuery("from Resource resource").getResultList();
| }
|
| @Destroy
| @Remove
| public void destroy() {
|
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981571#3981571
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981571
19 years, 6 months
[Persistence, JBoss/CMP, Hibernate, Database] - Daylight savings reveals serious brokeness
by dpocock
My environment:
JBoss 4.0.4.GA installed by JEMS installer
Mysql 4.0.24
mysql-connector-java-3.0.16-ga-bin.jar
I was working on an upgrade during the period between 0100 and 0200 BST, before the clock was to be rolled back (i.e. while British Summer Time still in effect). At this time, I noticed very unusual behaviour in one of my applications:
The application receives valid timestamps (in seconds since UTC) from a switch.
The application would do the following:
call start:
- cdr.setStartTime(new java.util.Date(timestamp * 1000))
- em.persist(cdr)
call connect:
- cdr = em.find(xxx)
- cdr.setConnectTime(new java.util.Date(timestamp * 1000))
- em.persist(cdr)
call stop:
- cdr = em.find(xxx)
- cdr.setFinishTime(new java.util.Date(timestamp * 1000))
- log(cdr.getStartTime().getTime() / 1000)
- log(cdr.getConnectTime().getTime() / 1000)
- log(cdr.getFinishTime().getTime() / 1000)
- em.persist(cdr)
The log output would show that the StartTime and ConnectTime values, when converted back to timestamps with `getTime()', were 3600 seconds ahead of the timestamps that had originally been stored, although finishtime was still the same.
For short calls, the equation (finishtime - connecttime) would return a negative value.
I inspected the database with mysql, all the times stored in SQL format appeared sequential (starttime < connecttime < finishtime)
I waited for the clock to hit 01:59:59 BST, it rolled back to 01:00:00 GMT. I then repeated the test, and the problem had vanished.
To any worried customers reading this: please note this is not our live VoIP service I am describing.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981566#3981566
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981566
19 years, 6 months