| org.apache.cocoon.components.modules.database.AbstractAutoIncrementModule org.apache.cocoon.components.modules.database.ManualAutoIncrementModule
ManualAutoIncrementModule | public class ManualAutoIncrementModule extends AbstractAutoIncrementModule implements ThreadSafe(Code) | | Abstraction layer to encapsulate different DBMS behaviour for
autoincrement columns.
Here: manual mode The new value is determined by doing a "select
max(column)+1 from table" query. With transactions and correct
isolation levels, this should to the trick almost everywhere.
Note however, that the above query does not prevent a parallel
transaction to try to insert a row with the same ID since it
requires only shared locks. C.f. "Phantom Problem"
author: Christian Haul version: CVS $Id: ManualAutoIncrementModule.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public Object | getPostValue(Configuration tableConf, Configuration columnConf, Configuration modenConf, Connection conn, Statement stmt, Map objectModel) | public Object | getPreValue(Configuration tableConf, Configuration columnConf, Configuration modeConf, Connection conn, Map objectModel) | final protected synchronized String | getSelectQuery(String tableName, Configuration entry) | public String | getSubquery(Configuration tableConf, Configuration columnConf, Configuration modeConf) | public boolean | includeAsValue() | public boolean | includeInQuery() | final protected synchronized void | setSelectQuery(String tableName, Configuration entry) Set the String representation of the MaxID lookup statement. |
getPreValue | public Object getPreValue(Configuration tableConf, Configuration columnConf, Configuration modeConf, Connection conn, Map objectModel) throws SQLException, ConfigurationException(Code) | | |
getSelectQuery | final protected synchronized String getSelectQuery(String tableName, Configuration entry) throws ConfigurationException(Code) | | |
getSubquery | public String getSubquery(Configuration tableConf, Configuration columnConf, Configuration modeConf) throws ConfigurationException(Code) | | |
includeAsValue | public boolean includeAsValue()(Code) | | |
includeInQuery | public boolean includeInQuery()(Code) | | |
setSelectQuery | final protected synchronized void setSelectQuery(String tableName, Configuration entry) throws ConfigurationException(Code) | | Set the String representation of the MaxID lookup statement. This is
mapped to the Configuration object itself, so if it doesn't exist,
it will be created.
|
Fields inherited from org.apache.cocoon.components.modules.database.AbstractAutoIncrementModule | protected HashMap settings(Code)(Java Doc)
|
Methods inherited from org.apache.cocoon.components.modules.database.AbstractAutoIncrementModule | public void configure(Configuration conf) throws ConfigurationException(Code)(Java Doc) public void dispose()(Code)(Java Doc)
|
|
|