Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Latest entries

< Previous page   Next page >
How do you use Hibernate Extended Sessions?

The Open Session in View pattern is very popular when Hibernate is used in a web application. This allows you to safely use managed entities when your view is being rendered. At Terracotta, we're currently researching what other patterns are popular for Hibernate and how people apply them.

One that I'm in particular looking into is the Extended Session pattern for long running conversations. This allows you to disconnect a Hibernate session in between requests and to store it in the HTTP session in the meantime.

I'd like to know who's using the extended session pattern and what you use it for.

To understand more about this, I developed a small example application to get a feel for the advantages, the benefits, the gotchas and the surprises. The application can be found below, it is inspired by snippets from Hibernate tutorials and example applications:

http://svn.terracotta.org/svn/forge/projects/hibernate-disconnected/trunk/

The example uses only servlets, filters and Hibernate. It is a webapp that allows you to create events and add people to it over different requests. When an event has been created with all the relevant people, it can be committed in one step. The intermediate state is kept within the managed entities and the Hibernate session until it's flushed.

This is what I found worth mentioning:

  • Whenever a transaction is created and committed, it doesn't matter if Hibernate flush mode is set to manual, certain operations like persist and merge will be propagated to the database at transaction commit. However, modifications to managed entities wont be committed, this can be confusing.
  • Even with manually flushed sessions, transactions are always real database transactions, causing locks to be held. They thus need to be as short as possible.
  • A single general-purpose servlet filter might not be feasible, depending on how transactions should behave. In this application, I ended up creating only a transaction around the actual session flush.
  • Data that is present in a manually flushed session buffer is batched but not available for queries.
  • This doesn't behave the same as a database transaction with isolation levels that can still see their own changes.
  • If the data needs to be available for a query, a commit needs to happen first.
  • This can require application changes, like a redirect after form submission in case transactions are automatically committed through a servlet filter.

Totally unrelated but cool, you can use an AnnotationConfiguration class to setup the Hibernate config and use a fluent interface to add the managed entity classes. This reduces the amount of XML and eases maintenance (see HibernateUtil class in my example).

posted by Geert Bevin in Java on Apr 16, 2009 3:53 PM : 4 comments [permalink]
 
First recordings of my new band ... check it out!

I've been extremely busy during the last months since I picked up music again alongside my day-job. You might have noticed from the severe lack of blog posts that I didn't have much time to spare ;)

I started a new band, called Flytecase and have been composing, arranging and rehearsing new songs like there's no tomorrow. This weekend, we finished recording and mixing two of our songs. I'd be very interested to know what people think about them.

You can check them out here: http://flytecase.be

Note that our site redirects to a public Facebook page, but you don't to be a Facebook member to listen to the songs. However if you are, please consider leaving a comment on our wall and to sign yourself up as a fan when you like the music.

posted by Geert Bevin in Music on Mar 2, 2009 3:28 PM : 0 comments [permalink]
 
JavaZone 2008 : Bytecode Manipulation in the Real World

I just finished my talk at JavaZone 2008 about bytecode manipulation.

You can download the presentation's PDF file from:

http://uwyn.com/download/bytecode_real_world.pdf

This is the abstract:

Bytecode Manipulation in the Real World

Bytecode manipulation has become increasingly popular over the last years. It is used by JPA implementations, application servers, AOP libraries, web frameworks, monitoring systems, profilers, clustering solutions, scripting languages, workflow engines, and much more. In fact, most of today's applications will most probably rely on byte code manipulation, often even without realizing.

Application developers however seem to be overly careful and often frown upon bytecode manipulation as an arcane art that is risky and difficult to understand. This presentation will show you that it's easier than you think. We'll go over concise examples that illustrate the concepts. Distinct patterns, coming from different domains, will give you ideas about adopting byte code manipulation for your own products. You'll learn arguments to reassure skeptics and see how the manipulation can plugged into your tool chain. We'll finish off with tips and tricks to write maintainable code with the ASM library.

After this session you'll see byte code manipulation as another tool in your arsenal and you'll have a good picture of how to start using it yourself.

Outline:

  • What is bytecode manipulation?
  • Some popular projects that use it
  • Don't be afraid
  • Plug in the manipulation
  • Best practices
posted by Geert Bevin in Java on Sep 17, 2008 1:29 PM : 0 comments [permalink]
 
Game Review : Alone in the Dark for XBox 360

box artThis is a first for me, I don't usually review games. I like Alone in the Dark so much thought, that I felt like talking about it.

I bought this game after having read all the bad reviews out there. However, it seemed to me that most criticisms boiled down to the reviewers being unable to handle the controls or being unwilling to take a little bit of time to get used to them. The graphics that I saw, the description of the features, the game play, and the storyline all attracted me, so I got the game a week ago.

I just finished it and I have to say that I rarely have had so much fun with a game. It's entirely different from any other next gen title out there in that it generally allows you to take your time and think things through. You can combine many real world objects to create bombs, set cars on fire, create gasoline trails, glue molotov cocktails to enemies, etc. The right approach often gets you through a tough spot without have to resort close combat. I've seen videos of players just storming into scenes and having an impossible time getting through them because they didn't properly look at the possibilities beforehand.

This game stems from the great line of adventure games of old, yet it take everything into this new generation by give you a great free-roaming world with kick ass physics. Sure, there are frustrating sections that take a lot of practice and skill to succeed (like the car chases), but if you don't like this kind of game play ... just skip it. With its DVD menu system, Alone In The Dark let's you play what you want and doesn't force you, what a novel idea! Personally, I found these sections thrilling since after some practice you get through them and really feel a sense of accomplishment.

What more to say. The inventory system is awesome and not frustrating thanks to the shortcuts that you can setup. The switch between first person and third person isn't gratuitous and instead serve very different purposes and allow you to fully appreciate the game. The fighting system where you control the weapon with the right analog stick is just awesome. It's like having a mini Wii controller on the 360's game pad. Additionally, it allows you grab objects and move them around you in three-dimensional space to solve puzzles. This is once more very innovative and refreshing.

Finally, it seems to me that Alone in the Dark is a work of art and that it's simple not appreciated by the mainstream press. This is nothing new and often happens to visionaries. I for one hope that Eden Studios will continue along this path and surprise me with other games in the future. We need studios that dare to step outside the beaten path and execute this in such a masterful way as Alone in the Dark.

Thanks a lot for this game!

Scores

10.0Presentation
Everything oozes quality. The menu system, the inventory, the atmosphere, the in-game hints. Perfect score!
9.0Graphics
The graphics are in general top-notch though there's some clipping or frame rate dips. The whole cinematic feel is dead on though and regularly shows breathtaking scenes.
10.0Sound
Perfect and thrilling! This music score could have been done for a Hollywood block buster!
9.0Gameplay
It takes a little while to get used to the large set of controls. They quickly feel natural though and allow you to interact with the world in a totally novel fashion.
7.0Lasting Appeal
The game is short and I will probably not replay it. However, the story line and atmosphere is so good that it will probably become one of those reference games that I think of for many years to come.
9.0OVERALL
(out of 10 / not an average)
posted by Geert Bevin in Gaming on Aug 10, 2008 10:55 PM : 2 comments [permalink]
 
Channel Intelligence's European patent application is in bad shape

Today one of the Belgian patent information centers got back to me to discuss the state of Channel Intelligence's European patent application. They confirm that the patent is indeed still under examination and that means that it has not even been sent to the local patent offices of each individual country where this patent would apply.

The patent has been under examination for over 7 years and Channel Intelligence has been gradually trying to adapt some of the claims to get it past the examinator. The fact that it is taking this long is a good sign since it means that the patent office never consider it to be into an acceptable state and it already went through several iterations. Also, since this is clearly a software patent, the representative of this Belgian information center confirmed that it will be almost impossible for this patent application to be approved in Europe.

He suggested that I put a comprehensive dossier together with all prior art and detailed explanations about how they invalidate the novelty and inventiveness of the patent. This seems to correspond with what's written in article 115 of the European Patent Convention. The examinator however has no obligation to take this into consideration. At his sole discretion he can decide to use or ignore the information that is sent to him.

However, that's not all. In the very unlikely event that this patent might be accepted in Europe, there's still a 9 month period after the acceptance date where an official protest can be filed. This doesn't have to be done through a lawyer and can simply be coordinated with a local patent office. Such actions however can't be ignored and will have to be examined in detail by the global European Patent Office.

I thus plan on creating this dossier and also publish it on my blog. Anybody that feels strongly against this patent will then be able to use this information to send his or her own letter to the patent office. If we coordinate this correctly, they might not be able to ignore the pressure.

Thanks a lot everyone for all your support. I'm amazed at how friendly and helpful everyone has been so far.

posted by Geert Bevin in Channel Intelligence vs. Uwyn on Jul 24, 2008 8:47 PM : 8 comments [permalink]
 

< Previous page   Next page >
 
 
 
Google
rifers.org web