db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (TORQUE-16) LockTables is faulty in some adapters
Date Mon, 24 Sep 2012 07:08:18 GMT

     [ https://issues.apache.org/jira/browse/TORQUE-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Fox closed TORQUE-16.
----------------------------

    
>  LockTables is faulty in some adapters
> --------------------------------------
>
>                 Key: TORQUE-16
>                 URL: https://issues.apache.org/jira/browse/TORQUE-16
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 3.1, 3.1.1, 3.2
>         Environment: mssql, oracle
>            Reporter: Thomas Fox
>            Assignee: Thomas Fox
>             Fix For: 4.0-beta1
>
>
> Sent to me from Michael Beier
> in some adapters (e.g mssql, sybase) lockTables is implemented as follows:
> public void lockTable(Connection con, String table) throws SQLException
> {
>     Statement statement = con.createStatement();
>  
>     stmt.append("SELECT next_id FROM ")
>         .append(table)
>         .append(" FOR UPDATE");
> }
>  
> Problem is that the column next_id does not exist in most tables.
> Suggested is to replace this as follows:
> Mssql:
> {
>     Statement statement = con.createStatement();
>  
>     StringBuffer stmt = new StringBuffer();
>     stmt.append("SELECT * FROM ")
>   .append(table)
>   .append(" WITH (TABLOCKX)");
>  
>     statement.executeQuery(stmt.toString());
> }
> Oracle:
> public void lockTable(Connection con, String table) throws SQLException
> {
>     Statement statement = con.createStatement();
>  
>     StringBuffer stmt = new StringBuffer();
>     stmt.append("SELECT * FROM ")
>         .append(table)
>         .append(" FOR UPDATE");
>  
>     statement.executeQuery(stmt.toString());
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message