One of our customers recently contacted us with questions on hibernate and ASE. Not much information is out there to provide the kind of details the customer was seeking. I thought it was a good topic to post on SCN. A disclaimer is in order. The document is provided for the information purposes only. This may not be viewed as any kind of guarantee or certification of Hibernate on ASE.
Briefly, Hibernare is an object to relational mapping middle tier that makes the task of writing java applications against standard relational databases much easier. It is a de facto standard in java/J2EE domain. A simple example of how this works is as follows.
If your application is required to save, retrieve, manipulate data of customers from a customer table in a database that has 3 columns - name, city and zipcode, you would typically create a java class called "Customer" with three properties of name, city and zipcode. Methods on that class such as save, get, modify will use standard JDBC API to implement the required functionality. Anyone who has used JDBC to perform these type of actions realizes how tedious this is to use for hundreds of java classes typically required in any project.
Hibernate, an open source technology managed by Red Hat, makes life easier for a java/jdbc developer. It allows developers to focus on implementing business logic while it takes care of creating, excuting sql statements, converting data types between sql and database data types, looping through result sets, caching frequently used data etc. To follow our example,
Hibernate implemention simply requires us to create an xml file that maps java classes to corresponding database tables. If you have a customer.save method, hibernate creates a sql statement like - insert into customer ......
Hibernate has evolved into group of many other related products over the years. http://hibernate.org provides lot of valuable information. An initiative undertaken in former Sybase a few years back, aimed to provide information to the user community about the ASE's compatibility to hibernate. Majority of the compatibility issues were reviewed and resolved then. They are documented here. Because Hiberante is rapidly evolving and the user community has opted Hibernate as a standard, it is imperative that we provide our users with the latest information on the compatibility. Before we get into the steps taken to ensure compatibility it is important to understand how Hibernate provides a consistent experience across databases from different vendors. We know that almost all standard databases mostly implement jdbc api to provide a consistent user experience. But they also seek to distinguish themselves by providing features not supported by others.
Hibernate deals with these inconsitencies through the use of Dialect files. Dialect files are used to list database functions, db specific data types, reserved words or keywords and unsupported functionality (example - cascade delete not supported by ASE). Each hibernate module comes with a test folder that includes all the tests for that module. ASE engineering team, the one I belong to, has a scheduled jenkins job that runs tests on hibernate-core module every day. The tests run on Hibernate 4.3.5 and ASE 15.7 SP100. We intend to keep running the tests on the latest certified release of hibernate at the time. Red Hat plans to to run similar tests on their infrastructure so as to catch bugs at an early stage. The process of dealing with bugs is as follows.
When a test is found to be failing a JIRA ticket is created. The incidence is investigated and if determined to be a bug in the hibernate code, then one of the top contributors typically work on it. On the other hand if it is simply a test issue like misusing a keyword for table name then any contributor can fix it. If it is determined that the test is for a new functionality in Hibernate that can not be supported by ASE, then the particular test is annotated for skipping during a test cycle. By re-running these tests often and investigating the results we have been able to identify some key settings on ASE that help reduce the number of test
failures. The settings are believed to help not just in testing but in production scenarios also.
The test results and related information of internal jenkins job is accessible through SAP internal wiki.
In addition wiki page on Hibernate website also provides valuable information. https://community.jboss.org/wiki/HibernateSybaseintegration
Being an open source project, Hibernate provides source code freely to every one through git hub. You can git clone https://github.com/hibernate/hibernate-orm to get the source code. The dialect files I mentioned before are under hibernate-core/src/main/java/org/hibernate/dialect. The tests are run using a gradle wrapper and instructions although somewhat cryptic are available on hibernate website. Please reach out to me if you need more information on how to run the test suite on ASE.