Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleSQL Options

It is possible to redefine any or all all the SQL statements that are sent to the database by the JDBCStorageService. The following is the list

Option Property Name

Default

Notes

preCreateQuerySQL

SELECT expires FROM StorageRecords WHERE context =? AND id=?

The SQL to query the state of the table prior to creating a new record.

Issued in the same transaction as createCreateRecordSQL or createUpdateRecordSQL

createCreateRecordSQL

INSERT INTO StorageRecords(context, id, expires, value, version) VALUES (?, ?, ?, ?, 1)

The SQL to create a new record.

Issued in the same transaction as preCreateQuerySQL

createUpdateRecordSQL

UPDATE StorageRecords SET value=?, version=1, expires=? WHERE context=? AND id=?

The SQL to create a update an expired record (instead of a create)

Issued in the same transaction as preCreateQuerySQL

deleteByContextExpiredSQL

DELETE FROM StorageRecords WHERE context = ? AND expires < ?

The SQL to “reap” away expired records for a given context

deleteByContextSQL

DELETE FROM StorageRecords WHERE context = ?

The SQL to remove all records for a given context

deleteByExpiredSQL

DELETE FROM StorageRecords WHERE expires < ?

The SQL to remove all expired records (as part of the cleanup task)

preDeleteQuerySQL

SELECT version FROM StorageRecords WHERE context =? AND id=?

The SQL to determine whether the a record is the correct one to be deleted.

Issues in the same transaction as deleteRecordSQL

deleteRecordSQL

DELETE FROM StorageRecords WHERE context=? AND id=?

The SQL to delete a specific record.

Issued in the same transaction as preDeleteQuerySQL

preUpdateQuerySQL

SELECT version, expires, value FROM StorageRecords WHERE context =? AND id=?

The SQL to determine the state of a record prior to its update

Issued in the same transaction as updateRecordSQL

updateRecordSQL

UPDATE StorageRecords SET value=?, version=?, expires=? WHERE context=? AND id=?

The SQL to update a specific record

Issued in the same transaction as preUpdateQuerySQL

readAllByContextSQL

SELECT id, expires, value, version FROM StorageRecords WHERE context = ?

The SQL to return all the records associated with a specific context

readAllSQL

SELECT context, id, expires, value, version FROM StorageRecords

The SQL to return all the records

readContextsSQL

SELECT context FROM StorageRecords

The SQL to return all the context names

readRecordSQL

SELECT version, expires, value FROM StorageRecords WHERE context =? AND id=?

The SQL to read a specified record.

updateExpiresByContextSQL

UPDATE StorageRecords SET expires = ? WHERE context = ? AND expires > ?

The SQL to refresh the expiration of all currently unexpired records.

...