ServiceLocator’dan Inversion of Control’e Yolculuk

Harezmi Bilişim Çözümleri olarak 7 seneden fazla bir zamandır Spring Application Framework ile ilgili eğitimler veriyoruz. J2EE’nin ilk dönemlerinde kurumsal Java uygulamaları geliştirilirken kullanılan  ServiceLocator örüntüsünün nasıl IoC veya Dependency Injection’a doğru evrildiğini anlamanın Spring Application Framework’ün özünü ve temel felsefesini anlamak için çok faydalı olduğunu düşündüğümüz için de eğitimelerimizde Spring’i anlatmaya bu konu üzerinden […]

Read More →
Hibernate EntityCopyObserver: What Is It Used For?

JPA merge operation is used to reconnect and synchronize detached entities with active PersistenceContext so that changes performed on them could be reflected onto the database. Due to its complex nature, there might be times when multiple representations of an entity appears in the merge  process. Hibernate throws IllegalStateException in that case, because allowing each […]

Read More →
EhCache Configuration in Replicated Mode

In cluster environments, you can configure EhCache in two different topologies, one is distributed, and the other is replicated. In replicated mode, each EhCache instance in the network acts as a peer. There is no master cache. Instances communicated with each other via multicast network messages through RMI. Configuration of EhCache in replicated mode is […]

Read More →
Hibernate Events and Custom EventListener Registration

Since Hibernate 3, each and every operation through Session API fires one or more persistence events during the course of its execution. For example, when you invoke session.get(Foo.class,1L), in order to fetch Foo entity with PK 1, Hibernate fires events with pre-load, load and post-load event types. There is a seperate EventListener interface for each […]

Read More →
Is It Possible To Change Entity Fetch Strategy During Hibernate Merge?

When I talk with my colleague about my experience with Hibernate merge behavior on lazy associations with cascade type merge, he suggested me to check if Hibernate allows us to change fetch logic it applies on detached entities during merge operation. That way, it would be possible to suppress eager initialization of those associations during merge. Hibernate […]

Read More →
Hibernate Merge may Cause EAGER Initialization of LAZY OneToOne Associations

Let’s have following two simple entities, having 1:1 lazy association between each other. @Entity @Table(name=”T_FOO”) public class Foo { @Id @GeneratedValue private Long id; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE) @JoinColumn(name = “bar_id”) private Bar bar; public Long getId() { return id; } public Bar getBar() { return bar; } public void setBar(Bar bar) { […]

Read More →
Feature Interaction Problems and Spring Security

Feature interaction problem is something that features work smoothly and without any problem in your system individually; however, problems arise with those features when you bring them together. Bertrand Meyer has recently published his thoughts about the topic as well. While reading on it, I’ve come to realize that Spring Security has several similar issues […]

Read More →
Weird Rollback Behavior of Spring TestContext Framework

One of the nice features of TestContext module of Spring Application Framework is its ability to run unit tests within a transaction context. By that way, you are able to both execute your persistence operations which usually expect an active transaction to run, and also rollback state changes occur during execution of these persistence operations […]

Read More →