When creating managed beans ...

A best practice for managed beans that is often (and I admit easily) overlooked is to implement the Java Serializable interface for beans in session, pageFlow and view scope.

You wont recognize the absence of Serializable before running your application in a fail over environment.

As it fits into this context: Note that managed beans can inherit from a parent. So you may want to design a base managed bean class that contains helper functions you often need and that also implements Serializable. Then, with a little change to your coding guidelines, that managed beans must extend the base bean, you ensure your application's managed beans are always serializable.

Note that under the Tools | Preferences | Audit | Profiles entry, Oracle JDeveloper has an audit rule to find managed beans that are not serializable

Frank
Comments:

A few days ago I came across this page and have liked the info. I look forward to long term tips and can surely link to your and inform the people. Thanks.

Posted by Migraine Treatment on April 16, 2011 at 11:11 AM BST #

Awesome blog post. You surely know what you are writing about here. I am so happy I was able to find your Blog. I expect to see more great writing from you. Keep up the best work

Posted by Snoring Poseidon on April 16, 2011 at 12:19 PM BST #

Heya i am for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and help others like you aided me.

Posted by Baingana on April 26, 2011 at 03:32 PM BST #

Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is great blog.

Posted by best cash isas on April 29, 2011 at 09:40 AM BST #

Thanks for the post, couple of questions as I am a newbie
1.Since managed beans are not exchanged over network,could you please explain why managed beans in pageflow, session or view scope should be serialized?
2. Shouldn't managed beans in request scope be serialized?
3. How would normal environment and fail over environment be different with respect to the serialization of managed beans?

Posted by guest on March 03, 2014 at 03:19 AM GMT #

1.Since managed beans are not exchanged over network,could you please explain why managed beans in pageflow, session or view scope should be serialized?

Managed bean state is exchanged if you enable fail over in Oracle ADF (add-config.xml setting). Also for when you pass managed beans into a bounded task flow this makes sense

2. Shouldn't managed beans in request scope be serialized?

No need because the scope is too narrow for it being kept

3. How would normal environment and fail over environment be different with respect to the serialization of managed beans?

They are not different. Its just that if you run your application in a cluster for fail over, the managed bean state needs to be passed

Posted by Frank Nimphius on March 03, 2014 at 07:18 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

logo
A blog maintained by the JDeveloper product management team. We'll use it to post announcements, occasional how-to's and any other relevant information around JDeveloper and ADF.

See other PM Blogs

Shay, Frank, Grant, Duncan, Chris, Steve ,Joe, Dana, Many more in our blog feed
Follow JDeveloper on Twitter and Facebook

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today