1 Reply Latest reply on Nov 30, 2005 7:31 PM by Luigi Putanesca

    Why does hibernate create

    Luigi Putanesca Newbie

      I'm using JBoss 4.0.3 with EJB 3.0.

      I've found a situation where I run a query that loads an entity containing LAZY relationships, sometimes instead of getting the class I expect, i.e., "IpAddress", I get something like "IpAddress$$EnhancerByCGLIB$$f7ea24cb"

      This leads to various problems including ClassCastExceptions and org.hibernate.MappingExceptions.

      Although I've found some work arounds such as making the relationship EAGER or using INNER JOIN FETCH in my initial query, this problem still bothers me for the following reason:

      Once this class gets generated in a given transaction, I have found no way to undo the damage without ending the transaction, even if I re-run a query that loads everything eagerly.

      I'm just wondering what this class is, why this happens at all and would like to understand the issue better so I know better how to code to avoid problems without making everything EAGER.

      Does anyone have some insight on this?