Just a wild guess since I cannot see the attached picture (gmane did not store it)

do you have lazy references, and do you open and close the session before the rendering of the table.

This is basically the cause of most access problems.
The main problem is, that if you access data which is lazyly bound
outside of a closed session you will get errors, most errors of feeding
data from a data source into the table happen that way, and the users
usually are left wondering why that happened, because the data objects
are there.
So either keep your session open until the last milisecond, or prefetch the data you want to display in the session.


The best way to do the keep the session open as long as you need is by using a session per request filter
which opens the sessions before anything else is done
and closes it once everything else has finished.
Then you can mix and match lazy and non lazy references
left and right and do not have to care about the access code anymore.


See following references regarding this:

http://http//hibernate.org/43.html

and also

http://wiki.apache.org/myfaces/HibernateAndMyFaces


this article mentions a one session per session filter,
but I cannot recommend that one unless you only have a handful of users:

http://blog.exadel.com/?p=8



Johannes Hiemer wrote:
Hi,
I am getting into trouble with a bit adavanced hibernate query that I want to 
show up in a datatable.
That is my hibernate query:
        public List getRequests() {
                return getHibernateTemplate()
                                .find("from Request request, Customer customer, 
Employee employee, System system,"
                         + " Systemerror systemerror, Customee customee WHERE 
request.Rcustomer = customer.Cid"
+ " AND request.Rscheduler = employee.Eid AND request.Rfieldengineer = employee.Eid " + " AND request.Rtag = system.Sid AND request.Rerror = systemerror.Seid AND" + " request.Rcustomee = customee.Cid");
        }

And it returns the following structure
@see attached picture.

So I am loading the query just the normal way I always to into a list
@SuppressWarnings("unchecked")
        private void populateRequestBean() {
                request = getRequestManager().getRequests();
        }

Now I try to get the values of the list in my datatable as an output. I tried 
many ways, but I did not get it till yet.

<x:dataTable id="data" var="request" value="#{listrequestsSpringBean.request}">
                        <h:column>
                                <f:facet name="header">
                                        <h:outputText 
value="#{bundle.listrequestsRID}" />
                                </f:facet>
                                <h:outputText 
value="#{request.object.request.rid}" />
                        </h:column>

Is the way I am doing right or wrong?
Did anyone solve a similiar problem?

I hope anyone can help me.

Thanks a lot

Regards Johannes
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



Reply via email to