From: Charles M. (JIRA) <no...@at...> - 2006-07-21 21:34:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479?page=comments#action_23723 ] Charles McGuire commented on HHH-1479: -------------------------------------- We ran smack into this problem this week, too. Any suggestions about how to work around this, short of stepping down to Hibernate 2? > Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400 > ----------------------------------------------------------------------- > > Key: HHH-1479 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479 > Project: Hibernate3 > Type: Patch > Versions: 3.1 > Environment: Hibernate 3.1 > JDBC driver: JTOpen (for IBM AS/400) http://jt400.sourceforge.net > Reporter: Davide Rogora > > > Hello, > I've noticed that from version 3.1 Hibernate, when calling JDBC driver for INSERT statement, uses the following prepareStatement method: > prepareStatement(String sql, String[] columnNames) > instead of the following > prepareStatement(String sql, int autoGeneratedKeys) > used since versione 3.0.x > the problem is that JDBC driver for AS/400 (project JTOpen on sourceforge: http://jt400.sourceforge.net) doesn't support the method prepareStatement(String sql, String[] columnNames) so it's not possible to use Hibernate 3.1 with AS/400 > I've also noticed that other open source drivers that support this method (for example MySQL Jdbcconnector or JTDS for Ms-SQLServer) have implemented it using a workaround; infact they call the "old" prepareStatement(String sql, int autoGeneratedKeys) method ignoring the content of the columnNames array. > Here is the source of the jtds implementation: > ------------------------------------------------------------------------------- > public PreparedStatement prepareStatement(String sql, String[] columnNames) > throws SQLException { > if (columnNames == null) { > throw new SQLException( > Messages.get("error.generic.nullparam", "prepareStatement"),"HY092"); > } else if (columnNames.length != 1) { > throw new SQLException( > Messages.get("error.generic.needcolname", "prepareStatement"),"HY092"); > } > return prepareStatement(sql, JtdsStatement.RETURN_GENERATED_KEYS); > } > ------------------------------------------------------------------------------- > So I'm asking to the Hibernate team if it's possible to use the old method prepareStatement(String sql, int autoGeneratedKeys) in the future releases of Hibernate. > Thanks, > Davide Rogora. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: scott m g. (JIRA) <no...@at...> - 2006-07-22 01:30:18
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479?page=comments#action_23724 ] scott m gardner commented on HHH-1479: -------------------------------------- One work around is to go back version 3.0.5. It still works in that release. That is what we are doing now. > Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400 > ----------------------------------------------------------------------- > > Key: HHH-1479 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479 > Project: Hibernate3 > Type: Patch > Versions: 3.1 > Environment: Hibernate 3.1 > JDBC driver: JTOpen (for IBM AS/400) http://jt400.sourceforge.net > Reporter: Davide Rogora > > > Hello, > I've noticed that from version 3.1 Hibernate, when calling JDBC driver for INSERT statement, uses the following prepareStatement method: > prepareStatement(String sql, String[] columnNames) > instead of the following > prepareStatement(String sql, int autoGeneratedKeys) > used since versione 3.0.x > the problem is that JDBC driver for AS/400 (project JTOpen on sourceforge: http://jt400.sourceforge.net) doesn't support the method prepareStatement(String sql, String[] columnNames) so it's not possible to use Hibernate 3.1 with AS/400 > I've also noticed that other open source drivers that support this method (for example MySQL Jdbcconnector or JTDS for Ms-SQLServer) have implemented it using a workaround; infact they call the "old" prepareStatement(String sql, int autoGeneratedKeys) method ignoring the content of the columnNames array. > Here is the source of the jtds implementation: > ------------------------------------------------------------------------------- > public PreparedStatement prepareStatement(String sql, String[] columnNames) > throws SQLException { > if (columnNames == null) { > throw new SQLException( > Messages.get("error.generic.nullparam", "prepareStatement"),"HY092"); > } else if (columnNames.length != 1) { > throw new SQLException( > Messages.get("error.generic.needcolname", "prepareStatement"),"HY092"); > } > return prepareStatement(sql, JtdsStatement.RETURN_GENERATED_KEYS); > } > ------------------------------------------------------------------------------- > So I'm asking to the Hibernate team if it's possible to use the old method prepareStatement(String sql, int autoGeneratedKeys) in the future releases of Hibernate. > Thanks, > Davide Rogora. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Muthu (JIRA) <no...@at...> - 2006-07-24 17:20:12
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479?page=comments#action_23741 ] Muthu commented on HHH-1479: ---------------------------- We had same issue too. We replaced org.hibernate.util.GetGeneratedKeysHelper of 3.1 with one from 3.0 and re-jared it. It works fine now. > Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400 > ----------------------------------------------------------------------- > > Key: HHH-1479 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479 > Project: Hibernate3 > Type: Patch > Versions: 3.1 > Environment: Hibernate 3.1 > JDBC driver: JTOpen (for IBM AS/400) http://jt400.sourceforge.net > Reporter: Davide Rogora > > > Hello, > I've noticed that from version 3.1 Hibernate, when calling JDBC driver for INSERT statement, uses the following prepareStatement method: > prepareStatement(String sql, String[] columnNames) > instead of the following > prepareStatement(String sql, int autoGeneratedKeys) > used since versione 3.0.x > the problem is that JDBC driver for AS/400 (project JTOpen on sourceforge: http://jt400.sourceforge.net) doesn't support the method prepareStatement(String sql, String[] columnNames) so it's not possible to use Hibernate 3.1 with AS/400 > I've also noticed that other open source drivers that support this method (for example MySQL Jdbcconnector or JTDS for Ms-SQLServer) have implemented it using a workaround; infact they call the "old" prepareStatement(String sql, int autoGeneratedKeys) method ignoring the content of the columnNames array. > Here is the source of the jtds implementation: > ------------------------------------------------------------------------------- > public PreparedStatement prepareStatement(String sql, String[] columnNames) > throws SQLException { > if (columnNames == null) { > throw new SQLException( > Messages.get("error.generic.nullparam", "prepareStatement"),"HY092"); > } else if (columnNames.length != 1) { > throw new SQLException( > Messages.get("error.generic.needcolname", "prepareStatement"),"HY092"); > } > return prepareStatement(sql, JtdsStatement.RETURN_GENERATED_KEYS); > } > ------------------------------------------------------------------------------- > So I'm asking to the Hibernate team if it's possible to use the old method prepareStatement(String sql, int autoGeneratedKeys) in the future releases of Hibernate. > Thanks, > Davide Rogora. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Muthu (JIRA) <no...@at...> - 2006-07-24 17:22:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479?page=comments#action_23742 ] Muthu commented on HHH-1479: ---------------------------- Related issue can be found here http://forum.hibernate.org/viewtopic.php?t=960818&highlight= > Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400 > ----------------------------------------------------------------------- > > Key: HHH-1479 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479 > Project: Hibernate3 > Type: Patch > Versions: 3.1 > Environment: Hibernate 3.1 > JDBC driver: JTOpen (for IBM AS/400) http://jt400.sourceforge.net > Reporter: Davide Rogora > > > Hello, > I've noticed that from version 3.1 Hibernate, when calling JDBC driver for INSERT statement, uses the following prepareStatement method: > prepareStatement(String sql, String[] columnNames) > instead of the following > prepareStatement(String sql, int autoGeneratedKeys) > used since versione 3.0.x > the problem is that JDBC driver for AS/400 (project JTOpen on sourceforge: http://jt400.sourceforge.net) doesn't support the method prepareStatement(String sql, String[] columnNames) so it's not possible to use Hibernate 3.1 with AS/400 > I've also noticed that other open source drivers that support this method (for example MySQL Jdbcconnector or JTDS for Ms-SQLServer) have implemented it using a workaround; infact they call the "old" prepareStatement(String sql, int autoGeneratedKeys) method ignoring the content of the columnNames array. > Here is the source of the jtds implementation: > ------------------------------------------------------------------------------- > public PreparedStatement prepareStatement(String sql, String[] columnNames) > throws SQLException { > if (columnNames == null) { > throw new SQLException( > Messages.get("error.generic.nullparam", "prepareStatement"),"HY092"); > } else if (columnNames.length != 1) { > throw new SQLException( > Messages.get("error.generic.needcolname", "prepareStatement"),"HY092"); > } > return prepareStatement(sql, JtdsStatement.RETURN_GENERATED_KEYS); > } > ------------------------------------------------------------------------------- > So I'm asking to the Hibernate team if it's possible to use the old method prepareStatement(String sql, int autoGeneratedKeys) in the future releases of Hibernate. > Thanks, > Davide Rogora. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |