Message.obtain() and new Message() – TIP

Is not possible send the same Message instance several time, only once. So we always have to create a new instance. Better than that, instead of create a new instance (new Message()), we can use the method obtain (Message.obtain()) that will return a recycled instance of Message from the pool of recycled objects, what is … Continue lendo Message.obtain() and new Message() – TIP

Service restart behavior – Compilation

START_STICKY Service is restarted if it gets terminated. It will tell the system to create a newest copy of the service, when available memory is sufficient to do, after it retains state and recovers from the low memory. In this process we will loose the results that might have calculated before. onStartCommand() will be called on the … Continue lendo Service restart behavior – Compilation

Hibernate JPA 2.1 – StoredProcedureQuery

Thanks to... someone... that we have JPA 2.1 and the feature StoredProcedureQuery. Throught this method we can call easily a procedure in our database, set parameters and convert the possible result into Java object automatically. Let's imagine a simple procedure called 'SALES_ACCOUNTING' that receives two dates ('INITIALDATE' and 'FINALDATE') that determine the time period and … Continue lendo Hibernate JPA 2.1 – StoredProcedureQuery

Hibernate and Firebird – Support for Temporary Tables

I had problems to use Hibernate(JPA) to work with Firebird a while ago. Every connection opened was not being closed, I couldn't ever think to use a pool of connection in my web service and the temporary tables was being created next to other tables. In this post, I will focus on the problem with … Continue lendo Hibernate and Firebird – Support for Temporary Tables