Re: Hibernate Object and JSF Bean Design

2007-01-28 Thread stormspire

When I use OptimizeIt to check objects inside memory, I find many SQL String
inside, I doubt it is related to Hibernate.  I suspect the Hibernate object
life cycle doesn't end even a request is completed.

btw, I am using OpenSessionInView filter.



Mario Ivankovits wrote:
 
 Hi!
 Well, I work in an mid size project, approx 3000 java files and 300 jsps.
 No need for load balancing or failover, which makes things easier ;-)
   
 Oh, I forget, we directly use Hibernate Objects in our view too.
 
 
 Ciao,
 Mario
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.html#a8683409
Sent from the MyFaces - Users mailing list archive at Nabble.com.



RE: Hibernate Object and JSF Bean Design

2007-01-19 Thread stormspire

Hi,
  That means action layer can't take advantage of lazy loading feature any
more if detach the hibernate object and view object.
   It's also troublesome to copy value from entity to view object one by
one, and it will decrease performance if using reflecting.
   Will this approach considered as proper way to do it?

Regards
Bruce



Beelen, Marco wrote:
 
 Hi,
 
 I would agree with your friend.
 
 Although rendering pages does become easier when using the hibernate
 proxy object in your managed-beans directly, it could cause problems
 with being detached from the HibernateSession after the RestoreView
 phase. ( Even when using the HibernateSessionInView-filter. )
 
 When we switched to 'proper' view-objects and also were able to increase
 the performance of the application by retrieve all needed properties of
 an object at once instead of loading them one-by-one.
 
 I would never use hibernate proxies again in my managed-beans.
 
 With kind regards,
   Marco Beelen
 
 
 
 
 -Original Message-
 From: stormspire [mailto:[EMAIL PROTECTED] 
 Sent: donderdag 18 januari 2007 8:22
 To: users@myfaces.apache.org
 Subject: Hibernate Object and JSF Bean Design
 
 
 Now my JSF managed Bean contains some business object which is hiberante
 object.  
 My friend told me this design is wrong, he says the managed bean should
 contain only View Object, and contents of view object is translated from
 business object.
 
 Am I really Wrong?
 
 As I use lots of lazy loading from hibernate, so I can directly call
 object
 lazily loaded for master and detail example.  Any comments?
 -- 
 View this message in context:
 http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.htm
 l#a8425940
 Sent from the MyFaces - Users mailing list archive at Nabble.com.
 
 
 
 
 --
 Notice:  This e-mail message, together with any attachments, contains
 information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station,
 New Jersey, USA 08889), and/or its affiliates (which may be known
 outside the United States as Merck Frosst, Merck Sharp  Dohme or MSD
 and in Japan, as Banyu - direct contact information for affiliates is 
 available at http://www.merck.com/contact/contacts.html) that may be 
 confidential, proprietary copyrighted and/or legally privileged. It is 
 intended solely for the use of the individual or entity named on this 
 message. If you are not the intended recipient, and have received this 
 message in error, please notify us immediately by reply e-mail and then 
 delete it from your system.
 
 --
 
 

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.html#a8445639
Sent from the MyFaces - Users mailing list archive at Nabble.com.



RE: Hibernate Object and JSF Bean Design

2007-01-19 Thread stormspire

Hi,
  Right now we are using HibernateInView filter, normally won't have problem
for transactions.  However if we got some exception, the session may be lost
(haven't gone to the detail, dunno why).
  If my managed bean consists two actions, one action retrieves object,
another action update the object.  So if don't use independant view object
to store the value, the hibernate entity will still be available during
these requests, will it still held database connection for it?  If so, I
think it is not scalable.  How JBoss Seam solve it?

Regards
Bruce



Giampaolo Tomassoni-2 wrote:
 
 From: stormspire [mailto:[EMAIL PROTECTED]
 
 Now my JSF managed Bean contains some business object which is hiberante
 object.  
 My friend told me this design is wrong, he says the managed bean should
 contain only View Object, and contents of view object is translated from
 business object.
 
 Am I really Wrong?
 
 As I use lots of lazy loading from hibernate, so I can directly 
 call object
 lazily loaded for master and detail example.  Any comments?
 
 JSF beans may need to be persisted into the session object, so you may get
 problems with transaction boundaries unless you're very careful in
 handling the (de)serialization process and the Hibernate's session and
 connection.
 
 An out-of-the-shelf approach with similar results but more powerful and
 reliable for you would probably be JBoss Seam, which basicly allows direct
 visibility of business entities from JSF, while correctly handling a lot
 of the hinders which may arise with this.
 
 You may find it here: http://labs.jboss.com/portal/jbossseam . They say
 it's production. I would say it is an advanced beta. Anyway, what is the
 difference today?
 
 Cheers,
 
 Giampaolo
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf30326
 08.html#a8425940
 Sent from the MyFaces - Users mailing list archive at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.html#a8445701
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Hibernate Object and JSF Bean Design

2007-01-17 Thread stormspire

Now my JSF managed Bean contains some business object which is hiberante
object.  
My friend told me this design is wrong, he says the managed bean should
contain only View Object, and contents of view object is translated from
business object.

Am I really Wrong?

As I use lots of lazy loading from hibernate, so I can directly call object
lazily loaded for master and detail example.  Any comments?
-- 
View this message in context: 
http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.html#a8425940
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: trace response time and status for action method

2007-01-14 Thread stormspire

it's really a great tool, however I have no idea how to use this tool to
collect information like whether the response is successfully executed,
that's no FacesException throwed.

What I am doing now is run a stressing test, and after some while,
collection information like avg execute time, how many percent of request
failed.



Cagatay Civici wrote:
 
 Hi,
 
 Facestrace could help for some of your requirements;
 
 http://facestrace.sourceforge.net/
 
 Online Demo;
 
 http://www.cagataycivici.com/facestrace/
 
 Cheers,
 
 Cagatay
 Coast Guard
 
 On 1/12/07, stormspire [EMAIL PROTECTED] wrote:


 I can gather response time information from servlet filter, but I also
 want
 to know whether this method is executed successfully, so need catch
 exceptions throwed by action.



 Simon Kitching-3 wrote:
 
  stormspire wrote:
  I want to trace every request submitted, thus for every action, I need
  how
  much time it takes to process, whether it throws sys/application
  exceptions
  etc.
 
  Anywhere I can catch them?
 
  Tracing request times could be done using a JSF PhaseListener I guess.
  However personally I would just write a plain ServletFilter (a servlet
  concept, not a JSF concept). I suspect that there are already
  servlet-filter-based performance monitoring tools you can just
 download.
  And Tomcat already has basic stats gathering built in to its console
  webapp.
 
  Don't know what you mean by exceptions.
 
  Regards,
 
  Simon
 
 

 --
 View this message in context:
 http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8292284
 Sent from the MyFaces - Users mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8365765
Sent from the MyFaces - Users mailing list archive at Nabble.com.



RE: trace response time and status for action method

2007-01-14 Thread stormspire

sounds good.
How to register this action listener?  Will it catch all the requests
including normal form submission?



Madhav Bhargava-2 wrote:
 
 
 Another way to capture exceptions and calculate time take by action
 methods is to create your own action listener class. This class should
 extend ActionListenerImpl. Implement processAction method in the new
 class that you have created.
 
 
 
 
 Put something like this:
 
 
 
 
 try {
 
 super.processAction(event);
 
 }catch(Exception e) {
 
 //Put stuff here.
 
 
 }
 
 
 
 
 
 
 
 
 
 From: Cagatay Civici [mailto:[EMAIL PROTECTED]
 
 Sent: Friday, January 12, 2007 3:30 PM
 To: MyFaces Discussion
 Subject: Re: trace response time and status for action method
 
 
 
 
 Hi,
 
 Facestrace could help for some of your requirements;
 
 http://facestrace.sourceforge.net/
 
 Online Demo;
 
 http://www.cagataycivici.com/facestrace/
 
 Cheers,
 
 Cagatay
 Coast Guard
 
 On 1/12/07, stormspire  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:
 
 
 I can gather response time information from servlet filter, but I also
 want
 
 to know whether this method is executed successfully, so need catch
 exceptions throwed by action.
 
 
 
 Simon Kitching-3 wrote:

 stormspire wrote:
 I want to trace every request submitted, thus for every action, I
 need
 
 how
 much time it takes to process, whether it throws sys/application
 exceptions
 etc.

 Anywhere I can catch them?

 Tracing request times could be done using a JSF PhaseListener I guess.
 
 However personally I would just write a plain ServletFilter (a servlet
 concept, not a JSF concept). I suspect that there are already
 servlet-filter-based performance monitoring tools you can just
 download.
 
 And Tomcat already has basic stats gathering built in to its console
 webapp.

 Don't know what you mean by exceptions.

 Regards,

 Simon


 
 --
 View this message in context:
 http://www.nabble.com/trace-response-time-and-status-for-action-method-t
 f2963341.html#a8292284
 
 Sent from the MyFaces - Users mailing list archive at Nabble.com.
 
 
 
 
 
 
  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
 solely for the use of the addressee(s). If you are not the intended
 recipient, please notify the sender by e-mail and delete the original
 message. Further, you are not to copy, disclose, or distribute this e-mail
 or its contents to any other person and any such actions are unlawful.
 This e-mail may contain viruses. Infosys has taken every reasonable
 precaution to minimize this risk, but is not liable for any damage you may
 sustain as a result of any virus in this e-mail. You should carry out your
 own virus checks before opening the e-mail or attachment. Infosys reserves
 the right to monitor and review the content of all messages sent to or
 from this e-mail address. Messages sent to or from this e-mail address may
 be stored on the Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***
 

-- 
View this message in context: 
http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8365833
Sent from the MyFaces - Users mailing list archive at Nabble.com.



RE: trace response time and status for action method

2007-01-14 Thread stormspire

en, that's great!

but seems the action listener can only trace POST method, through UICommand
component.
if I want to trace Get method, can only go through Phase Listener?


Madhav Bhargava-2 wrote:
 
 
 You can register your own action listener by just declaring the
 following in faces-config.xml
 
 application
   action-listener
   com.yourpackage.YourActionListener
   /action-listener
 /application
 
 ~madhav
 
 stormspire wrote:
 sounds good.
 How to register this action listener?  Will it catch all the requests
 including normal form submission?

 

 

 
 Madhav Bhargava-2 wrote:
 
 
  Another way to capture exceptions and calculate time take by action
  methods is to create your own action listener class. This class
 should
  extend ActionListenerImpl. Implement processAction method in the new
  class that you have created.
 
 
 
 
  Put something like this:
 
 
 
 
  try {
 
  super.processAction(event);
 
  }catch(Exception e) {
 
  //Put stuff here.
 
 
  }
 
 
  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
 solely for the use of the addressee(s). If you are not the intended
 recipient, please notify the sender by e-mail and delete the original
 message. Further, you are not to copy, disclose, or distribute this e-mail
 or its contents to any other person and any such actions are unlawful.
 This e-mail may contain viruses. Infosys has taken every reasonable
 precaution to minimize this risk, but is not liable for any damage you may
 sustain as a result of any virus in this e-mail. You should carry out your
 own virus checks before opening the e-mail or attachment. Infosys reserves
 the right to monitor and review the content of all messages sent to or
 from this e-mail address. Messages sent to or from this e-mail address may
 be stored on the Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***
 
 

-- 
View this message in context: 
http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8367152
Sent from the MyFaces - Users mailing list archive at Nabble.com.



return null vs navigation rule from action method

2007-01-11 Thread stormspire

I am using saveState with myfaces.  Now I faces a problem, I have a page,
after submit it to an action method, I have done some business process, then
change values that will be presented in the page.  If I use return null at
the end of action method, the page won't refresh with latest value.  I have
to declare a navigation rule inside faces-config.xml and using 'return
someRule' to refresh the values.

I am wondering what's the correct way to do it, doubt the second way will
have unnecessary process.
-- 
View this message in context: 
http://www.nabble.com/return-null-vs-navigation-rule-from-action-method-tf2963340.html#a8291127
Sent from the MyFaces - Users mailing list archive at Nabble.com.



trace response time and status for action method

2007-01-11 Thread stormspire

I want to trace every request submitted, thus for every action, I need how
much time it takes to process, whether it throws sys/application exceptions
etc.

Anywhere I can catch them?
-- 
View this message in context: 
http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8291128
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: trace response time and status for action method

2007-01-11 Thread stormspire

I can gather response time information from servlet filter, but I also want
to know whether this method is executed successfully, so need catch
exceptions throwed by action.



Simon Kitching-3 wrote:
 
 stormspire wrote:
 I want to trace every request submitted, thus for every action, I need
 how
 much time it takes to process, whether it throws sys/application
 exceptions
 etc.
 
 Anywhere I can catch them?
 
 Tracing request times could be done using a JSF PhaseListener I guess. 
 However personally I would just write a plain ServletFilter (a servlet 
 concept, not a JSF concept). I suspect that there are already 
 servlet-filter-based performance monitoring tools you can just download. 
 And Tomcat already has basic stats gathering built in to its console
 webapp.
 
 Don't know what you mean by exceptions.
 
 Regards,
 
 Simon
 
 

-- 
View this message in context: 
http://www.nabble.com/trace-response-time-and-status-for-action-method-tf2963341.html#a8292284
Sent from the MyFaces - Users mailing list archive at Nabble.com.



timeout for SaveState on server side

2006-12-30 Thread stormspire

if I use savestate to store a bean on server side, when will it be destroyed?  
What I expect is if I navigate from one page to another page, the state in
first page won't be in server if I don't require it on second page.
-- 
View this message in context: 
http://www.nabble.com/timeout-for-SaveState-on-server-side-tf2897980.html#a8096615
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Performance Issue

2006-12-27 Thread stormspire

We have a memory constraint here, is there any one has done application
successfully with large pool of concurrent users?  We use statestate
extensively, and we save the whole bean usually, i doubt this is the problem
for us.  It doesn't scale very well.


Dennis Byrne wrote:
 
one question: when the beans declared in faces-config are created?  upon
request?
When will the app server destroy beans inside server, only after session
expired according to application config?
 
 The beans declared in faces-config are created and destroyed according to
 scope (none, request, session and application ) and access.  For example,
 a request scope bean is created upon first access and marked for garbage
 completion (provided no other references to it) at the end of the request. 
 Scope is configured in you faces-config file.
 
 any other way to improve it?  I am considering switching to client
 state,
 and add a compression on the state.  Anyone has already done it?
 
 Server side state saving is almost always faster than client side state
 saving, although it uses more memory.
 
 Dennis Byrne
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Performance-Issue-tf2884773.html#a8070705
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Performance Issue

2006-12-26 Thread stormspire

We are using Myfaces 1.1.5 SNAPSHOT + tomahawk-1.1.5-SNAPSHOT +
tomahawk-sandbox-1.1.5-SNAPSHOT + facelets in websphere environment.
We have big performance issue, not only the response is slow, avg 6 seconds,
but also our application consumes lots of memory.
The max heap size for us is 512M, although it is slow, another application
with more users resided in the same app server doesn't have performance
issue, it's also using 512M max heap size.  That application is using
struts.

Right now we usually save state the whole bean, and using server side.  I
follow http://wiki.apache.org/myfaces/Performance quite closely. Is there
any other way to improve it?  I am considering switching to client state,
and add a compression on the state.  Anyone has already done it?
-- 
View this message in context: 
http://www.nabble.com/Performance-Issue-tf2884773.html#a8059829
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Performance Issue

2006-12-26 Thread stormspire

one question: when the beans declared in faces-config are created?  upon
request?
When will the app server destroy beans inside server, only after session
expired according to application config?



stormspire wrote:
 
 We are using Myfaces 1.1.5 SNAPSHOT + tomahawk-1.1.5-SNAPSHOT +
 tomahawk-sandbox-1.1.5-SNAPSHOT + facelets in websphere environment.
 We have big performance issue, not only the response is slow, avg 6
 seconds, but also our application consumes lots of memory.
 The max heap size for us is 512M, although it is slow, another application
 with more users resided in the same app server doesn't have performance
 issue, it's also using 512M max heap size.  That application is using
 struts.
 
 Right now we usually save state the whole bean, and using server side.  I
 follow http://wiki.apache.org/myfaces/Performance quite closely. Is there
 any other way to improve it?  I am considering switching to client state,
 and add a compression on the state.  Anyone has already done it?
 

-- 
View this message in context: 
http://www.nabble.com/Performance-Issue-tf2884773.html#a8059842
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Questions about tree2 and Facelet

2006-09-20 Thread stormspire

I have faced the similar problem using tree2  facelets.
the version I used is 1.1.5, I think the solution post in
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk is for 1.1.3 and
prior verion.

i have your method below, however it doesn't work for me still, I can only
see the root level, and can't expand the + sign.

Could you post your simple workable version with facelets?  reall
appreciated your help!



Andrew Robinson-5 wrote:
 
 There is no such thing as a nested facet in JSF at all. A facet is a
 map of string-UIComponent in a component. Therefore, it is only 1
 level deep. When you put a panelGroup in a facet and put facets in
 that panelGroup you are simply creating this structure:
 
 Tree2 - [Facet] - PanelGroup - [Facet] - SomeComponent
 
 The second facet is a facet of the panel group and is totally
 unrelated to the tree2 component. PanelGroups never render their
 facets with the default renderer, so the SomeComponent will never be
 rendered.
 
 If you want to have different behavior for expanded or collapsed
 nodes, you will have to (1) use EL in your node facet or (2) create
 separate nodes for expanded/collapsed.
 
 From your example, I recommend (1)
 
 t:tree2 id=clientTree value=#{csc_CSCTreeBean.treeData}
 var=node varNodeToggler=t
 f:facet name=person
   h:panelGroup
 t:graphicImage value=#{t.nodeExpanded ?
   'images/yellow-folder-open.png' :
   'images/yellow-folder-closed.png'}
   border=0/
 h:outputText value=#{node.description} styleClass=nodeFolder/
   /h:panelGroup
 /f:facet
 ...
 
 
 
 On 9/19/06, davy.mailing [EMAIL PROTECTED] wrote:


 Thank you very much

 I am still a little puzzled

 The code that i copied is from tomahawk sample code. And it really works
 .

 Maybe you mean we can't use nested facets in facelet?

 Thanks again for your help


  

 davy.mailing
 2006-09-20
  

 发件人: Andrew Robinson
 发送时间: 2006-09-19 23:51:45

 收件人: MyFaces Discussion
 抄送:
 主题: Re: Questions about tree2 and Facelet


 Why do you have nested facets? There should only be
 one facet per
 node type. Nested is not supported. Have a look at
 the example apps
 to see how to create the facets. The use of
 expand and collapse
 facets is not supported, especially when you
 have added these facets
 to a panel group. The panel group component does
 not render facets

 On 9/19/06, davy.mailing  [EMAIL PROTECTED]  wrote:
 
 
  Thanks for Andrew Robinson
 
  I wrote tree2.xhtml like this
 
 
   html xmlns=http://www.w3.org/1999/xhtml;
xmlns:ui=http://java.sun.com/jsf/facelets;
xmlns:h=http://java.sun.com/jsf/html;
xmlns:f=http://java.sun.com/jsf/core;
xmlns:t=http://myfaces.apache.org/tomahawk; 
   h:inputText value=test jsf/ 
   f:view 
   h:form id=tree 
   t:tree2 id=clientTree
  value=#{csc_CSCTreeBean.treeData} var=node
  varNodeToggler=t 
   f:facet name=person 
   h:panelGroup 
   f:facet name=expand 
   t:graphicImage
 value=images/yellow-folder-open.png
  rendered=#{t.nodeExpanded} border=0/ 
   /f:facet 
   f:facet name=collapse 
   t:graphicImage
 value=images/yellow-folder-closed.png
  rendered=#{!t.nodeExpanded} border=0/ 
   /f:facet 
   h:outputText value=#{node.description}
  styleClass=nodeFolder/ 
   /h:panelGroup 
   /f:facet 
   f:facet name=foo-folder 
   h:panelGroup 
   f:facet name=expand 
   t:graphicImage
 value=images/yellow-folder-open.png
  rendered=#{t.nodeExpanded} border=0/ 
   /f:facet 
   f:facet name=collapse 
   t:graphicImage
 value=images/yellow-folder-closed.png
  rendered=#{!t.nodeExpanded} border=0/ 
   /f:facet 
   h:outputText value=#{node.description}
  styleClass=nodeFolder/ 
   h:outputText value= (#{node.childCount})
  styleClass=childCount rendered=#{!empty
 node.children}/ 
   /h:panelGroup 
   /f:facet 
   f:facet name=bar-folder 
   h:panelGroup 
   f:facet name=expand 
   t:graphicImage
 value=images/blue-folder-open.gif
  rendered=#{t.nodeExpanded} border=0/ 
   /f:facet 
   f:facet name=collapse 
   t:graphicImage
 value=images/blue-folder-closed.png
  rendered=#{!t.nodeExpanded} border=0/ 
   /f:facet 
   h:outputText value=#{node.description}
  styleClass=nodeFolder/ 
   h:outputText value= (#{node.childCount})
  styleClass=childCount rendered=#{!empty
 node.children}/ 
   /h:panelGroup 
   /f:facet 
   f:facet name=document 
   h:panelGroup 
   h:commandLink immediate=true