Adrian, Thanks, that's brilliant. I have patched the standardjbosscmp-jdbc.xml and made two changes to the sybase configuration: I have added the following line to ensure only upto 250: <read-ahead><page-size>250</page-size></read-ahead> Sadly this only works if I change the <defaults> and not the sybase type-mapping. I believe this is an error in the DTD. If you fix this, please add 250 page-size to the sybase type-mapping.
I have also changed the type-mapping for Sybase to use LONGVARBINARY for IMAGE data instead of JAVA_OBJECT(? I think): <type-mapping> <name>Sybase</name> <!-- and so on --> <mapping> <java-type>java.lang.Object</java-type> <jdbc-type>LONGVARBINARY</jdbc-type> <sql-type>IMAGE</sql-type> </mapping> </type-mapping> Thanks, Jonathan O'Connor XCOM Dublin Adrian Brock <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 24.09.2003 14:02 Please respond to jboss-user To: [EMAIL PROTECTED] cc: Subject: Re: [JBoss-user] Bad SQL generated for Sybase 12.0 You can limit the ORs generated using the <page-size> on the <read-ahead>. Regards, Adrian On Wed, 2003-09-24 at 11:01, Jonathan.O'[EMAIL PROTECTED] wrote: > Running JBoss 3.0.6, running a finder on a entity bean, JBoss generates a > load query like: > select field1, field2, field3 from MY_TABLE where ID = 1 or ID = 2 or ID = > 3 ... > Normally this code is fine, however, the finder happens to find more than > 250 rows, and Sybase ASE12.0 does not like where clauses with more than > 250 ANDs or ORs. I tried changing the select statement to "Select field1, > field2, field3 from MY_TABLE where ID in (1, 2, 3...)" but this produced > the same error message. It seems Sybase translates the IN clause to a > series of ORs. > > Is the only work around to upgrade to 3.2.2 and use LIMIT and OFFSET to > get around the problem? Yes, I know this is probably a better solution in > the long run, but... > > Any advice would be appreciated. > Ciao, > Jonathan O'Connor > XCOM Dublin > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- xxxxxxxxxxxxxxxxxxxxxxxx Adrian Brock Director of Support Back Office JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user