Showing posts with label java ee. Show all posts
Showing posts with label java ee. Show all posts

Sunday, May 5, 2013

Java EE main method - Hello World application

    Java SE has clearly defined entry point of the program execution - 'public static void main(String[] args)' method. However, when it comes to Java EE such an entry point is blurred. Can we create main method in Java EE?

Friday, March 22, 2013

JBoss 4.2.2 GA to JDK 7 (or JDK 6) migration

    JBoss 4.2.2 GA was released long time ago. Despite that fact, some mature projects that run in production are deployed on mentioned JBoss. JBoss 4.2.2 GA is quite old, however it can be hosted on JDK7. Some minor changes are necessary, but they can be introduced quite easy. I decided to create this migration guide in order to save someone's day.

Friday, March 15, 2013

Are interceptors similar to EJBs?

    Being inspired by the blog entry and my current activity at work, I decided to present the behaviour of interceptors. Do they share something more with EJBs? Let's check it out!

Sunday, March 3, 2013

Hibernate flush modes

    Hibernate minimizes the trips to the database in order to gain some performance. It is the flush mode that controls how many times Hibernate hits the DB when it comes to write operations. The behaviour of the flushing mechanism is customizable. It is worth to know that the proper configuration of the flush mode can have quite a big influence on the overall performance (especially while testing when the transaction is not committed).

Saturday, February 23, 2013

Injecting Stateful Session Bean into servlet

    The advent of DI frameworks makes it natural to annotate a field with @EJB or @Inject and let the framework resolve the dependency for us. It can be that simple but sometimes something can behave incorrectly.

Sunday, February 3, 2013

I am optimistic... exception!

    Java EE applications usually handle many concurrent users. This means that there must exist some strategies that keep the data consistent in case of concurrent modification of the same database row (entity). JPA2 defines two types of locking, namely Optimistic Locking (OL) and Pessimistic Locking (PL).

Saturday, January 26, 2013

@SequenceGenerator revealed

The following trio of annotations is popular in JPA applications:
@Id

@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "customer_seq")

@SequenceGenerator(name = "customer_seq", sequenceName = "CUSTOMER_SEQ") 

Monday, January 21, 2013

Basic JPA mappings

    Sometimes, when I have to add a couple of mappings to the data model I have to spend a while to recall the correlation between JPA annotations and underlying database schema. I decided to create some kind of a cheat sheet with basic JPA mappings.

Saturday, January 19, 2013

JBoss 7.1.1, Eclipse Juno and Maven integration for blazing fast deployments

    Every time I want to gain some knowledge about new technology I create environment for that in order to touch the code. Such environment should respond very quickly for changes in the code so as I can see the effects immediately.