Interesting Java-related links. Week 13-15

These weeks didn’t have much time to dig into the feeds. However several useful articles appeared behind my eyes.

  1. Transaction strategies: Understanding transaction pitfalls – very clean explanation on what you can do wrong with transactions in your Spring, JPA, Hibernate app.
  2. Log Management Tools Face-Off: Splunk vs. Logstash vs. Sumo Logic – a good starting point in terms of selecting appropriate log management tool.

Interesting stuff:

  1. Discovered a new debugging technique for the big old project where lots of configuration comes from random places you’re not aware of yet. Of course this configuration influences flow and if you’d like to check some specific steps you might spend lots of time configuring things. So the easy solution is to put breakpoints in the IDE and add expressions into the “Watches”. Attempt to execute something like “cfg.setKeywords(“1”); cfg.setKeywordsActive(true);” will occur each time the code is stopped on the breakpoint and you’ll get your configuration right away. This approach is definitely better than hardcoding some values since the code does not really change and you won’t accidentally commit these.
  2. GenerationType.AUTO in the base class is bad for inheritance with Hibernate.
    Caused by: org.hibernate.MappingException: Cannot use identity column key
    generation with <union-subclass> mapping for: com.something.SuperClass
  3. Once the process is started it has some descriptors attached. Even if you add process user to some group – it won’t get rights automatically. You have to restart your process.
  4. Tomcat from Debian repo has weird libraries. I just couldn’t run JPA-based app, finally had to replace and add several libraries from the tomcat zip file downloaded from Apache
  5. Again got the problem when it takes ages to start Tomcat with HTTPS connector. The problem was pretty easy to solve this time since I’ve met it before. Changing   /dev/random to /dev/urandom in JDK security settings fixed the problem.
  6. Got to a pretty interesting case when I had two data sources in the persistence.xml. One for production, another – for testing with HSQL. When running tests EclipseLink was complaining about duplicated generated classes like Request_. Finally was fixed with adding subpackage property which changed the target package for entities watched by test datasource: <property name=”eclipselink.canonicalmodel.subpackage” value=”test”/>
  7. Got a very interesting case from the customer which caused DBCP to hang infinitely and not releasing connections. One more confirmation that writing multithreaded code is hard.
  8. ab – Apache Benchmark tool. Usually I use JMeter for load testing purposes. But lately was introduced to ab by one of the colleagues. Pretty simple tool to do quick verifications. And I really like the name.
  9. Got a perfect chance to get deeper into Tomcat and the way configuration can be injected via JNDIA bit deeper into Tomcat^ serving static contents, injecting properties via JNDI.
  10. Got a chance to play with CouchDB on the real but pretty small project. It was pretty easy to integrate it with the help of Ektorp. Hopefully I didn’t make much stupid newbie mistakes.
  11. Put my hands on to the Clojure language. I really like some aspects of it and really hate others. However it’s definitely worth looking at to broad the vision. Unless you’re already used to the functional way of things. Even presented some aspects of it to colleagues. Looks like that presentation was not that dull like presentations on the programming languages usually are.
This entry was posted in Development, Tips and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s