Adam Bien's Weblog

Sunday Feb 07, 2010

bad pbr sig - and a simple solution

After the addition of a hard disc to a mirrored zfs rpool, the boot process immediately stopped with the GRUB message: "bad pbr sig". It means that something is wrong with the Primary Boot Record (aka Master Boot Record). The solution was simple - I swapped the boot order of the hard discs in BIOS. Now it works perfectly again.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Saturday Feb 06, 2010

kenai.com is dead - long live kenai (under different name)

Even got this email: 

"In an effort to get information out to the Kenai community quickly, while trying to manage the integration of our two companies, I think we did a poor job at communicating our plans for Kenai.com to you.  I would like to remedy that now.  Our strategy is simple.  We don't believe it makes sense to continue investing in multiple hosted development sites that are basically doing the same thing.  Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community.  We are in the process of migrating java.net to the kenai technology.  This means that any project currently hosted on kenai.com will be able to continue as you are on java.net.  We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects.  So in the meantime I suggest that you stay put on kenai.com and let us work through the details and get back to you later this month. 

Thanks for your feedback and patience."

These are actually great news. Hopefully all the kenai.com infrastructure like mercurial (subversion isn't fun), jira and hudson will be supported by java.net. So I'm waiting with the migration of "Real World Java EE Patterns" project and will even commit some more content soon. The great story about mercurial: the whole repository with history etc. sits on my machine and can be pushed wherever I want :-). kenai.com is/was an interesting platform - suitable not only for opensource projects.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Tuesday Feb 02, 2010

Object Pooling Can Be Still Useful - For Entirely Different Reasons

Pooling was initially introduced as a tuning action for the slow performance of object creation and garbage collection in particular. On a modern JVM > 1.4 pooling is no more needed for the optimization of memory management in a typical business application. It can even have a negative effect on the garbage collector performance. In special cases, like creating millions of instances in every method call, it could still pay off. 

Instance pooling, however is still interesting for objects with slow custom "post construction". In some cases you want to inject some dependencies after the object creation, read some configuration etc. This can be slow and doesn't have to be performed over and over again. In such cases object pooling will improve the overall performance. 

Instead of prematurely optimize your application, I would rather build the simplest possible thing and measure the performance continuously (e.g. with VisualVM). In most cases you will be surprised where the actual bottlenecks actually are. 


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Saturday Jan 30, 2010

Free JUG Session In Hamburg - Real World Java EE Patterns - Rethinking Best Practices

At 02.02.2010, 8 P.M. I'm going to give a free JUG talk about Java EE 6 / 5 cool stuff and best practices in Hamburg.
We will discuss the relation between Contexts and Dependency Injection (CDI / JSR-299), Dependency Injection for Java (JSR-330) and EJB 3.1 - the lightweight components :-) Also the new Java EE 6 stuff like: stereotypes, interceptors, decorators, validation, REST + EJB 3.1 are going to be covered.
The Java EE 6 impact on architecture, build and test will be discussed as well. Heretical questions are especially welcome - this is a JUG session so it should be interactive fun.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Thursday Jan 28, 2010

Sun + Oracle, NetBeans, Glassfish, JavaOne and the Death of Kenai

JavaOne will take place in San Francisco from September 19-23, 2010 - so I was semi right :-). Most of the questions are answered here. kenai.com will be killed. What is a pity - it is/was a great platform with mercurial support. Glassfish, however, will be also commercially supported by Sun/Oracle.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Wednesday Jan 27, 2010

JDeveloper vs. NetBeans - The Poll Results

The results are amazing: 434 (NetBeans) vs. 18 (JDeveloper). JDeveloper comes with some interesting stuff - it would be a nice extension of NetBeans. The integration wouldn't be that hard - both IDEs are Swing based...


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Friday Jan 22, 2010

Sun + Oracle = Snorcle?

The new Sun + Oracle logo was revealed. Somehow aquarium / oracun and sparky related :-)


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Thursday Jan 21, 2010

Sun And Oracle - The Deal Is Approved

Some details. Hopefully the strategic plans / roadmap regarding Glassfish, NetBeans, OpenSolaris and hardware will be revealed soon. ...and what about JavaOne? :-)


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

My Opinion About Java FX

I was interviewed (java.sun.com) about Java FX in the enterprise, Java FX tooling and superfluous GoF patterns.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Friday Jan 15, 2010

Do We Need Stateless Session Bean Pooling?

Pooling is still mentioned in the EJB 3.1 / Java EE 6 specification. The question is: do you have to care? The answers are:

  1. Pooling is not a requirement, it is just an assumption: "...Since stateless session bean instances are typically pooled, the time of the client’s invocation of the create method need not have any direct relationship to the container’s invocation of the PostConstruct/ejbCreate method on the stateless session bean instance..."[EJB 3.1 spec, page 78]
  2. EJB container can either pool the instances or create a new one for each request
  3. The most important thing is, that every transaction (often request), gets an independent instance. Then you don't have to care about low level locking mechanisms. This can be achieved with or without (=creating a new instance for each request) pooling.
  4. Pooling is no more needed in modern JVMs for performance reasons in general. This, however, is highly dependent on the JVM and garbage collector configuration.
  5. With pools you can throttle the concurrency, because most (all I know) application servers allow you the configuration of max number of instances. You can control the concurrency of every bean type (Boundary) in a fine grained way. This is important for the avoidance of DoS attacks and dealing with legacy resources.

So pooling is not needed for performance or scalability reasons, rather than for the ease of use. You can easily restrict the scalability and you get a single threaded programming model for free. In day to day development you don't have to thing about pooling or instance management.

The only thing to remember is: every transaction runs in a dedicated Session Bean instance and thread.

[See Page 20 (EJB: Introducing Consistency) in Real World Java EE Patterns - Rethinking Best Practices book]


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Interviews/About
My Recent Book
Java One 2009
CommunityOne East N.Y.C
JavaONE 2008 Interview
Search
...the last 150 posts
...the last 10 comments
greenfire.dev.java.net
Links
my.netbeans.org
Visitors
License