You are probably accessing JavaModel objects when you are not holding the transaction lock. Remember that even asking an object for its name needs to be done inside a transaction. The best approach is to gather your data inside the transaction lock, keeping it as Strings or whatever, and then use that data if you need to display something.

Source: NetBeans FAQ