Hi,
I keep getting this error from Hibernate with MySQL:
Failed to lazily initialize a collection: SQLException initializing collection: General error, message from server: "Too many tables. MySQL can only use 31 tables in a join"
java.sql.SQLException: General error, message from server: "Too many tables. MySQL can only use 31 tables in a join"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:71)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:551)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:140)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:602)
at net.sf.hibernate.loader.CollectionLoader.initialize(CollectionLoader.java:82)
at net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:2897)
...
Is there something I can do to make Hibernate create smaller queries, or tune MySQL somehow? I'm using Hibernate 2.0.3.
Thanks,
/Anders
|