JavaFX 2 with JPA 2 and Drag and Drop – Part 1

After a bit of a break away doing other things I’m back on a project that uses JavaFX 2. So far this project hasn’t required much in the way of persistence either for settings or data but a new feature I’m working on makes use of a database. I use JPA 2 for web based projects and I’ve found it to be useful in most desktop applications as well so it was the natural choice here. How you go about bringing together JPA and JavaFX isn’t necessarily as obvious as it could be so I thought I’d write a small demonstration application. While writing the demo I decided I’d also have an explore of the drag and drop features of JavaFX and get it working with a TreeView which is a bit more challenging than with the other components.Continue reading

JPA2 Serialized Blob Never Really Null

This one got me late on a Friday (actually after work so I was doubly frustrated) and is to do with how JPA2 persists attributes of items that are not of basic Java types and which are also not entities. In order words attributes that implement Serializable and get shoved into BLOB fields.Continue reading

Local transaction already has 1 non-XA Resource

While developing a bit of functionality that transferred data from one database to another in my current JEE 6 web application I came upon the exception below. Surprisingly for exceptions from deep within system this one is actually quite informative if you understand what it’s saying: the key is knowing that XA means distributed transaction. Transactions can be one of two types either local or non-distributed or distributed. A local transaction is what you are normally doing, the transaction involves a single resource (a database connection for example) which is doing all the transactional work itself.Continue reading