Java has come a long way. A very long way. And it carries with it all the "junk" from early day design decisions. One thing that has been regretted time and again is the fact that every object (potentially) contains a monitor. This is hardly ever necessary and this flaw was corrected, finally, in Java … Continue reading If Java Were Designed Today: The Synchronizable Interface
Tag: try-with-resources
A Subtle AutoCloseable Contract Change Between Java 7 and Java 8
A nice feature of the Java 7 try-with-resources statement and the AutoCloseable type that was introduced to work with this statement is the fact that static code analysis tools can detect resource leaks. For instance, Eclipse: When you have the above configuration and you try running the following program, you'll get three warnings: public static … Continue reading A Subtle AutoCloseable Contract Change Between Java 7 and Java 8
Let’s Review How to Insert Clob or Blob via JDBC
LOBs are a PITA in all databases, as well as in JDBC. Handling them correctly takes a couple of lines of code, and you can be sure that you'll get it wrong eventually. Because you have to think of a couple of things: Foremost, LOBs are heavy resources that need special lifecycle management. Once you've … Continue reading Let’s Review How to Insert Clob or Blob via JDBC