Manage Node.js dependencies properly

Author of every piece of software bigger than simple “Hello World” sooner or later will face problem with dependency management. In this post I would like to consider that problem and possible solutions in regard to Node.js applications. In Node.js world managing dependencies with npm is exceptionally simple, however there are some caveats which everyone … Read more

Hibernate + 2nd level cache bug

Recently, I have come across a nasty bug. When Hibernate executes a cacheable query and applying a ResultTransformer on a result of that query, java.lang.ClassCastException is thrown. session.createCriteria(RateEntity.class) .add(Restrictions.eq(CURR_ID, criteria.getCurrency())) .add(Restrictions.eq(TYPE, criteria.getRateType().name())) .add(Restrictions.gt(TS_CRT, criteria.getFromTime().toDate())) .setProjection(Projections.projectionList() .add(Projections.property(TS_CRT), TIME_DTO_PROPERTY) .add(Projections.property(RATE), RATE_DTO_PROPERTY)) .addOrder(Order.asc(TS_CRT)) .setCacheable(true) .setResultTransformer(Transformers.aliasToBean(RateDTO.class)) .list(); It seems that the ResultTransformer is applied on the result before putting … Read more

Java enums + template method design pattern

Let’s consider the following code snippets: public enum Currency { EUR, USD }   String currency = “EUR”; if(Currency.EUR.name().equals(currency)){ System.out.println(“Transfer permitted”); } How often do we see much the same scenario? It is not completely wrong since there is a try to use enums so it is not entirely “string driven” programming. However there is … Read more

JPA EntityManager operations order

I have run into interesting issue recently. I use in the project JPA + Hibernate + EJB. The issue concerns saving and deleting entities in the same transaction. Database table which is used has an unique constraint defined on two columns. What I have done was removing entity calling entityManager.remove(); then the new entity has … Read more

Grails + Axon = CQRS (part II)

 As promised in one of the previous posts, I carry on series concerning Groovy, Grails and Axon framework in this case.  In Part I a few words have been written about Grails, CQRS and Axon. In this part, the sample application using mentioned technologies and architecture is presented. he application is developed in Grails. CQRS architecture … Read more

Jira – issue not visible on the agile board

JIRA agile, formerly known as GreenHopper (GreenHopper->JIRA Agile) has lots of nice features supporting agile planning during software development. This post involves th problem I have met using that feature. During my everyday duties concerning Jira from time to time I come across the following concern. When adding issue to the Jira it does not … Read more

Grails + Axon = CQRS (part I)

I continue series of posts regarding Groovy and Grails. In the previous post there were some starter information about Groovy programming language. In this one and the next one I would like to present sample application built with Grails and Axon which demonstrates a basic usage of CQRS architecture. Grails Grails is a rapid application … Read more

Groovy – Getting Started

As promised in the previous entry I am continuing series of Groovy posts. Starting from simple introduction we are moving to intermediate and advanced topics in the future posts. What is Groovy’s origin? Everything started in 2003 when James Strachan (official Groovy creator) wrote to Bob McWhirter: Wouldn’t it be “groovy” if we could have … Read more