Links

  • 1. Sogeti
  • 2. JBoss
  • 3. IBM
  • 4. Oracle
  • 5. SpringSource
  • 6. NL-JUG
  • 7. Java

Archives

Syndication  RSS 2.0

RSS 1.0
RSS 2.0

Bookmark this site

Add 'JCN Blog' site to delicious  Add 'JCN Blog' site to technorati  Add 'JCN Blog' site to digg  Add 'JCN Blog' site to dzone

Posted by Erik-Berndt Scheper at 17:10 on Wednesday 10 November    Add 'Using GIT over an authenticating NTLM (isa) proxy' site to delicious  Add 'Using GIT over an authenticating NTLM (isa) proxy' site to technorati  Add 'Using GIT over an authenticating NTLM (isa) proxy' site to digg  Add 'Using GIT over an authenticating NTLM (isa) proxy' site to dzone

Ever since Hibernate has moved to GIT, I’ve been looking for a way to fetch the latest updates from GitHub.  This is easy when you’re at home , or when your company does not use a Microsoft NTLM proxy. Just use EXPORT http_proxy=http://user:pass@proxyserver:port and you’re set.

However, Microsoft proxies does not accept this syntax. For most programs (java included) you’re safe with CNTLM, which is a very fast authenticating proxy. As a rule, you won’t see the difference in your browser. As a matter of fact, you can use CNTLM with Git, as long as you stick to the HTTP protocol. I.e. you’re using anonymous Git, and you won’t be able to push your code back to GitHub.

GitHub does support HTTPS and WebDAV to push your code, but if you try it with CNTLM, you’ll hit this bug in CNTLM. Basically what happens is that Git hangs forever. Fortunately, there’s another free authenticating NTLM proxy, called NTLMAPS and it’s written in Python. It’s a lot slower than CNTLM (which is written in C), so I wouldn’t recommend it for day-to-day usage but Git appears to works fine over it.

Read the rest of this entry »

Posted by Erik-Berndt Scheper at 21:33 on Monday 27 September    Add 'New committer for Hibernate Envers' site to delicious  Add 'New committer for Hibernate Envers' site to technorati  Add 'New committer for Hibernate Envers' site to digg  Add 'New committer for Hibernate Envers' site to dzone

I’ve been invited by Adam Warski to become a committer of the Hibernate Envers project. Yesterday I have made my first commit, resolving issue HHH-5560 .

Since Hibernate 3.5.0  Envers is a components of the Hibernate Core project, and can be used to maintain audit trails for all entities managed by Hibernate.

The general idea is that for every insert, update or remove operation, a row is inserted in the audit tables with the state and the action.

In the coming time I’ll be involved in fixing more bugs, updating documentation and perhaps adding extra functionality.

Posted by Jaap Coomans at 10:52 on Thursday 5 November    Add 'Don’t blame Hibernate, blame Spring!' site to delicious  Add 'Don’t blame Hibernate, blame Spring!' site to technorati  Add 'Don’t blame Hibernate, blame Spring!' site to digg  Add 'Don’t blame Hibernate, blame Spring!' site to dzone

A few months back I encountered a problem concerning hibernate.connection.release_mode. After my problem was solved by setting this property to 'after_statement' a colleague encountered the same problem and I advised him to use the same solution, which solved the problem again.

Today however, another colleague noticed this line in the logfile: "Overriding release mode as connection provider does not support 'after_statement'". A little investigation showed that this line is accompanied by a change from 'after_statement' to 'after_transaction'. So why is there apparently no change in the configuration at runtime, even though we noticed a difference in behaviour?

Read the rest of this entry »

Posted by Erik-Berndt Scheper at 23:35 on Wednesday 25 March    Add 'Hibernate Envers 1.2.0.GA released!' site to delicious  Add 'Hibernate Envers 1.2.0.GA released!' site to technorati  Add 'Hibernate Envers 1.2.0.GA released!' site to digg  Add 'Hibernate Envers 1.2.0.GA released!' site to dzone

This last year, I have been actively involved in setting up a new development tool-set for one of our customers. Amongst others, we have migrated from native Hibernate to JPA, using Hibernate as persistence provider (i.e. Hibernate EntityManager and Hibernate Annotations).

This is all very neat and works fine (just like everything that’s Open Source), so that’s not really worth blogging about. One of the more interesting requirements was that we needed to implement an audit trail in Java, because we are stuck with a rather primitive database that doesn’t natively support audit trails.
As a first cut, we wrote our own auditing implementation using standard JPA. Initially, that looked simple and neat. The idea was to define a default entity listener that does the auditing for every persisted object. Note that default entity listeners cannot be defined using annotations; you have to define this in the orm.xml file.
However, like all roll-your-own implementations (most at least), this lead to complications. First of all, JPA Entitylisteners are stateless. Secondly, the JPA spec insists that you may not use the same persistence context inside the entity listener. And last but not least, we could not inject Spring beans in the entity listener. So in the end we fixed it using a couple of more or less ugly hacks.

But then we (almost simultaneously with some colleagues from Logica working for the same customer) discovered Hibernate Envers. Personally, my first encounter was on theserverside.com, where an announcement had been posted that JBoss Envers was now part of the Hibernate Core and was re-dubbed to Hibernate Envers. The first release under the Hibernate flag will be 3.5, as the Hibernate implementation of JPA 2.0. But a backport for the current Hibernate (3.3.x) is available in a separate branch.

And this works great! All you have to do is configure Envers as Hibernate listeners in the persistence.xml file, and add @Audited annotations to all entities you wish to audit. You can then add @NotAudited to all properties you wish to exclude from auditing and everything is audited automatically. Envers scans the Hibernate EntityManager upon startup, creates new entities on the fly, based on the entities that have the @Audited annotation.
But you have to use Hibernate Annotations, it doesn’t work with .hbm.xml files.

Of course, we had some issues with it at first (such as  HHH-3729, HHH-3740 and HHH-3736) but my fixes for these issues are now part of the 1.2.0 GA release, and we lived happily ever after.

So if you ever need auditing with Hibernate and JPA, look out for Envers!

Posted by Eric Gunnewegh at 10:21 on Friday 9 February    Add 'An Introduction to Hibernate 3 Annotations' site to delicious  Add 'An Introduction to Hibernate 3 Annotations' site to technorati  Add 'An Introduction to Hibernate 3 Annotations' site to digg  Add 'An Introduction to Hibernate 3 Annotations' site to dzone

Over the years, Hibernate has become close to the defacto standard in the world of Java database persistence. It is powerful, flexible, and boasts excellent performance. In this article, John Ferguson Smart looks at how Java 5 annotations can be used to simplify your Hibernate code and make coding your persistence layer even easier.

Posted by Eric Gunnewegh at 8:01 on Wednesday 13 September    Add 'Hibernate can meet your validation needs' site to delicious  Add 'Hibernate can meet your validation needs' site to technorati  Add 'Hibernate can meet your validation needs' site to digg  Add 'Hibernate can meet your validation needs' site to dzone

While it’s important to build data validation into as many layers of a Web application as possible, it’s traditionally been very time-consuming to do so, leading many developers to just skip it — which can lead to a host of problems down the road. But with the introduction of annotations in the latest version of the Java™ platform, validation got a lot easier. In this article, Ted Bergeron shows you how to use the Validator component of Hibernate Annotations to build and maintain validation logic easily in your Web apps.

[IBM developerworks]

Posted by Ruud Steeghs at 19:43 on Wednesday 8 February    Add 'A New Java Persistence API for Berkeley DB' site to delicious  Add 'A New Java Persistence API for Berkeley DB' site to technorati  Add 'A New Java Persistence API for Berkeley DB' site to digg  Add 'A New Java Persistence API for Berkeley DB' site to dzone

Sleepycat Software is requesting feedback from its existing users and potential users on a new Java API for object persistence. This new API has similarities with, and significant differences from, other persistence approaches in Java such as EJB3 Java Persistence, Hibernate, and Java Data Objects (JDO).TSS

Posted by Hans-Jürgen Jacobs at 9:59 on Tuesday 18 October    Add 'Unit Testing Hibernate Mapping Configurations' site to delicious  Add 'Unit Testing Hibernate Mapping Configurations' site to technorati  Add 'Unit Testing Hibernate Mapping Configurations' site to digg  Add 'Unit Testing Hibernate Mapping Configurations' site to dzone

In the last few years, Hibernate has become one of the most popular Java open source frameworks available. However, developers don’t always remember that the mapping files that drive Hibernate’s behavior are as much a part of the program as the Java code. These files can contain defects, behave unexpectedly, and break when you change other parts of your system. In this article, I will show how you can use unit testing to assess the correctness of your Hibernate configuration. The article is a step-by-step approach that also explains some of the more common difficulties you may encounter while using Hibernate. [testdriven.com]

Posted by Hans-Jürgen Jacobs at 14:34 on Wednesday 13 July    Add 'Rails vs. J2EE' site to delicious  Add 'Rails vs. J2EE' site to technorati  Add 'Rails vs. J2EE' site to digg  Add 'Rails vs. J2EE' site to dzone

IBM has published an article comparing Ruby on Rails to J2EE (more specifically, against the combination of Tomcat, JSP, and Hibernate). [agileprogrammer]

Posted by Hans-Jürgen Jacobs at 16:57 on Friday 20 May    Add 'Wire Hibernate Transactions in Spring' site to delicious  Add 'Wire Hibernate Transactions in Spring' site to technorati  Add 'Wire Hibernate Transactions in Spring' site to digg  Add 'Wire Hibernate Transactions in Spring' site to dzone

The proper handling of transactions across multiple data stores, supporting multiple application flows, is the kind of heavy lifting J2EE servers were built for. But what if you’re using the lighter-weight Spring framework? Binildas C. A. shows how you can wire Spring and Hibernate together to achieve the transaction support you desire. [onjava.com]


© 2019 Java Competence Network. All Rights Reserved.