B.4. Sybase
Example B.10. Sybase Datasource
B.4.1. Sybase Limitations リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Sybase has some configuration anomalies, which you should be aware of.
- DDL statements in transactions
- Hibernate, which is an integral part of the Enterprise Platform, allows the SQL Dialect to decide whether or not the database supports DDL statements within a transaction. Sybase does not override this. the default is to query the JDBC metadata to see whether DDL is allowed within transactions. However, Sybase does not correct report whether it is set up to use this option.Sybase recommends against using DDL statements in transactions, because of locking issues. Review the Sybase documentation for how to enable or disable the
ddl in tran
option. - Sybase does not throw an exception if a value overflows the constraints of the underlying column.
- Sybase ASE does not throw an exception when Parameterized Sql is in use.
jconn3.jar
uses Parameterized Sql for insertion by default, so no exception is thrown if a value overflows the constraints of the underlying column. Since no exception is thrown, Hibernate cannot tell that the insert failed. By using Dynamic Prepare instead of Parameterized SQL, ASE throws an exception. Hibernate can catch this exception and act accordingly.For that reason, set theDynamic prepare
parameter totrue
in Hibernate's configuration file.<property name="connection.url">jdbc:sybase:Tds:aurum:1503/masterDb?DYNAMIC_PREPARE=true</property>
<property name="connection.url">jdbc:sybase:Tds:aurum:1503/masterDb?DYNAMIC_PREPARE=true</property>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow jconn4.jar
uses Dynamic Prepare by default. - SchemaExport cannot create stored procedures in chained transaction mode
- On Sybase, SchemaExport cannot be used to create stored procedures while in while in chained transaction mode. The workaround for this case is to add the following code immediately after the definition of the new stored procedure:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow