Databinder proxy bug: snapshot fix availableDatabinder proxy bug: snapshot fix available

Databinder user Chris wrote in last week to report a mapping exception he encountered using it with DataView. (Whether Databinder itself should talk to DataView is an open question.)

Chris was getting a Hibernate MappingException for an unknown entity with whose name included EnhancerByCGLIB—sound familiar? Hibernate was being asked to load a class that was just a proxy for the real, mapped class.

This happened because HibernateObjectModel’s setPersistentObject(obj) method, which retains the object’s class for loading it later, was not checking for Hibernate proxy objects. I’m surprised the condition didn’t arise in any of my examples, but who knows how and when Hibernate decides to use a proxy.

So I’ve reworked HibernateObjectModel to look out for proxies, using a mix of session.getEntityName() and some dirtier stuff. It would be nice if Hibernate translated between Java classes and entity names; then I could use entity names entirely. But Hibernate, if you haven’t noticed, is not the nicest library. (It might just be the meanest.)

I’ve also worked worked out a solution to the jumpy IE Ajax problem of my last post. It was-as I feared-to use an html table. Just sprinkle a little Web 0.5 on your Ajax, and hold your nose.

Anyone who’s getting bitten by the Hibernate proxy bug, please try this snapshot release of Databinder. It also has the IE table “fix” for SearchPanel, though I’m not sure if that alone is worth the download.

And shouldn’t that say “idiomas” ?

Codercomments

Yes, it should.

And it shouldn’t say “hablen”, but “hable”.

Once they’ve found their bilingual waitress, perhaps she’ll fix the sign. But then they won’t need it anymore. A paradoxical bug…

Add a comment