Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-3
-
None
-
None
Description
I wrote a class like this:
class ScoreChangeRecorder {
...
public ScoreChangeRecorder(date) {
try {
def String DROP_TABLE = """"
DROP TABLE balance_change_log_${date}
"""
sql.executeUpdate(DROPTABLE)
} catch (Exception e) {
}
this.date = date
dropTable()
def String CREATE_TABLE = """
CREATE TABLE balance_change_log_${date}
(
id serial NOT NULL PRIMARY KEY,
user_id int8,
money_point int4 NOT NULL,
balance int8,
reason text,
change_type text,
change_time timestamp NOT NULL,
raceid text
)
"""
sql.executeUpdate(CREATE_TABLE)
sql.commit()
STATEMENT = """
insert into balance_change_log_${date}(user_id, money_point, balance, reason, change_type, change_time, raceid)
values(?, ?, ?, ?, ?, ?, ?)
"""
ps = sql.connection.prepareStatement(STATEMENT)
}
public void finishWork() {
def String CREATE_INDEX = """
CREATE INDEX idx_change_log_${date} on balance_change_log_${date}(user_id)
"""
sql.executeUpdate(CREATE_INDEX)
sql.commit()
}
...
When I run the script, I got a confusing error: Verify error: Illegal exception range in finishWork!
If I just wrapped the try..catch block in another method, everything run ok.