Class SDriverSybase

java.lang.Object
simpleorm.sessionjdbc.SDriver
simpleorm.drivers.SDriverSybase

public class SDriverSybase extends SDriver
This contains Sybase Adaptive Server specific code.
  • Constructor Details

    • SDriverSybase

      public SDriverSybase()
  • Method Details

    • driverName

      protected String driverName()
      Description copied from class: SDriver
      The driver name to be compared to getMetaData().getDriverName()
      Overrides:
      driverName in class SDriver
    • columnTypeSQL

      protected String columnTypeSQL(SFieldScalar field, String defalt)
      Sybase only understands DATETIME (and SMALLDATETIME) and timestamp (must be lc!)
      Overrides:
      columnTypeSQL in class SDriver
    • forUpdateSQL

      protected String forUpdateSQL(boolean forUpdate)
      Description copied from class: SDriver
      Returns update clause, may not be valid in certain lock modes etc. Right at the end of the query.

      Oracle, Postgresql, and new in MS SQL 2005 support data versioning or snapshots. This means that repeatable read is achieved by caching the previous value read instead of using read locks. This approach makes it critical to add FOR UPDATE where appropriate or there is effectively no locking.

      Indeed, in Oracle, you are guaranteed that several SELECTS will return the same value, but a subsequent SELECT FOR UPDATE in the same transaction may return a different value.

      Overrides:
      forUpdateSQL in class SDriver
    • postFromSQL

      protected String postFromSQL(boolean forUpdate)
      MSSQL and Sybase do not support FOR UPDATE. But the docs say to use WITH (XLOCK). But Jorge says that it is unnecessary and makes SimpleORM fail. Very odd.
      Overrides:
      postFromSQL in class SDriver