Session.java (hsqldb-2.7.0) | : | Session.java (hsqldb-2.7.1) | ||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
import org.hsqldb.types.DateTimeType; | import org.hsqldb.types.DateTimeType; | |||
import org.hsqldb.types.TimeData; | import org.hsqldb.types.TimeData; | |||
import org.hsqldb.types.TimestampData; | import org.hsqldb.types.TimestampData; | |||
import org.hsqldb.types.Type; | import org.hsqldb.types.Type; | |||
import org.hsqldb.types.TypedComparator; | import org.hsqldb.types.TypedComparator; | |||
/** | /** | |||
* Implementation of SQL sessions. | * Implementation of SQL sessions. | |||
* | * | |||
* @author Fred Toussi (fredt@users dot sourceforge.net) | * @author Fred Toussi (fredt@users dot sourceforge.net) | |||
* @version 2.7.0 | * @version 2.7.1 | |||
* @since 1.7.0 | * @since 1.7.0 | |||
*/ | */ | |||
public class Session implements SessionInterface { | public class Session implements SessionInterface { | |||
// | // | |||
private volatile boolean isClosed; | private volatile boolean isClosed; | |||
// | // | |||
public Database database; | public Database database; | |||
private final User sessionUser; | private final User sessionUser; | |||
skipping to change at line 1233 | skipping to change at line 1233 | |||
return Result.newErrorResult(e); | return Result.newErrorResult(e); | |||
} | } | |||
Result result = null; | Result result = null; | |||
boolean recompile = false; | boolean recompile = false; | |||
HsqlName originalSchema = getCurrentSchemaHsqlName(); | HsqlName originalSchema = getCurrentSchemaHsqlName(); | |||
for (int i = 0; i < list.size(); i++) { | for (int i = 0; i < list.size(); i++) { | |||
Statement cs = (Statement) list.get(i); | Statement cs = (Statement) list.get(i); | |||
if (isClosed) { | ||||
result = Result.newErrorResult(Error.error(ErrorCode.X_08503)); | ||||
break; | ||||
} | ||||
if (i > 0) { | if (i > 0) { | |||
if (cs.getCompileTimestamp() | if (cs.getCompileTimestamp() | |||
> database.txManager.getSystemChangeNumber()) { | > database.txManager.getSystemChangeNumber()) { | |||
recompile = true; | recompile = true; | |||
} | } | |||
if (cs.getSchemaName() != null | if (cs.getSchemaName() != null | |||
&& cs.getSchemaName() != originalSchema) { | && cs.getSchemaName() != originalSchema) { | |||
recompile = true; | recompile = true; | |||
} | } | |||
skipping to change at line 1356 | skipping to change at line 1362 | |||
cs = sessionContext.currentStatement; | cs = sessionContext.currentStatement; | |||
if (cs == null) { | if (cs == null) { | |||
return Result.newErrorResult(Error.error(ErrorCode.X_07502)); | return Result.newErrorResult(Error.error(ErrorCode.X_07502)); | |||
} | } | |||
if (abortTransaction) { | if (abortTransaction) { | |||
return handleAbortTransaction(); | return handleAbortTransaction(); | |||
} | } | |||
boolean interrupted = false; | ||||
while (true) { | while (true) { | |||
try { | try { | |||
latch.await(); | latch.await(); | |||
} catch (InterruptedException e) { | } catch (InterruptedException e) { | |||
interrupted = txInterruptRollback; | if (txInterruptRollback) { | |||
database.txManager.resetSession( | ||||
this, this, Long.MAX_VALUE, | ||||
TransactionManager.resetSessionStatement); | ||||
abortTransaction = true; | ||||
break; | ||||
} | ||||
Thread.interrupted(); | Thread.interrupted(); | |||
continue; | continue; | |||
} | } | |||
break; | break; | |||
} | } | |||
if (abortAction) { | if (abortAction) { | |||
r = Result.newErrorResult(Error.error(ErrorCode.X_40502)); | r = Result.newErrorResult(Error.error(ErrorCode.X_40502)); | |||
endAction(r); | endAction(r); | |||
break repeatLoop; | break repeatLoop; | |||
} | } | |||
if (abortTransaction || interrupted) { | if (abortTransaction) { | |||
Result result = handleAbortTransaction(); | Result result = handleAbortTransaction(); | |||
if (interrupted) { | ||||
Thread.currentThread().interrupt(); | ||||
} | ||||
return result; | return result; | |||
} | } | |||
database.txManager.beginActionResume(this); | database.txManager.beginActionResume(this); | |||
// tempActionHistory.add("sql execute " + cs.sql + " " + acti onTimestamp + " " + rowActionList.size()); | // tempActionHistory.add("sql execute " + cs.sql + " " + acti onTimestamp + " " + rowActionList.size()); | |||
sessionContext.setDynamicArguments(pvals); | sessionContext.setDynamicArguments(pvals); | |||
r = cs.execute(this); | r = cs.execute(this); | |||
skipping to change at line 1417 | skipping to change at line 1425 | |||
break repeatLoop; | break repeatLoop; | |||
} | } | |||
if (redoAction) { | if (redoAction) { | |||
redoAction = false; | redoAction = false; | |||
while (true) { | while (true) { | |||
try { | try { | |||
latch.await(); | latch.await(); | |||
} catch (InterruptedException e) { | } catch (InterruptedException e) { | |||
if (txInterruptRollback) { | ||||
database.txManager.resetSession( | ||||
this, this, Long.MAX_VALUE, | ||||
TransactionManager.resetSessionStatement); | ||||
abortTransaction = true; | ||||
break repeatLoop; | ||||
} | ||||
Thread.interrupted(); | Thread.interrupted(); | |||
continue; | continue; | |||
} | } | |||
break; | break; | |||
} | } | |||
} else { | } else { | |||
break repeatLoop; | break repeatLoop; | |||
} | } | |||
skipping to change at line 1804 | skipping to change at line 1822 | |||
calendarGMT.setFirstDayOfWeek(Calendar.MONDAY); | calendarGMT.setFirstDayOfWeek(Calendar.MONDAY); | |||
calendarGMT.setMinimalDaysInFirstWeek(4); | calendarGMT.setMinimalDaysInFirstWeek(4); | |||
} | } | |||
return calendarGMT; | return calendarGMT; | |||
} | } | |||
public SimpleDateFormat getSimpleDateFormatGMT() { | public SimpleDateFormat getSimpleDateFormatGMT() { | |||
if (simpleDateFormatGMT == null) { | if (simpleDateFormatGMT == null) { | |||
simpleDateFormatGMT = new SimpleDateFormat("MMMM", Locale.ENGLISH); | simpleDateFormatGMT = new SimpleDateFormat("MMMM", | |||
HsqlDateTime.defaultLocale); | ||||
simpleDateFormatGMT.setCalendar(getCalendarGMT()); | simpleDateFormatGMT.setCalendar(getCalendarGMT()); | |||
} | } | |||
return simpleDateFormatGMT; | return simpleDateFormatGMT; | |||
} | } | |||
private Result getAttributesResult(int id) { | private Result getAttributesResult(int id) { | |||
Result r = Result.newSessionAttributesResult(); | Result r = Result.newSessionAttributesResult(); | |||
skipping to change at line 2310 | skipping to change at line 2329 | |||
return Tokens.T_SERIALIZABLE; | return Tokens.T_SERIALIZABLE; | |||
} | } | |||
} | } | |||
String getSetSchemaStatement() { | String getSetSchemaStatement() { | |||
return "SET SCHEMA " + currentSchema.statementName; | return "SET SCHEMA " + currentSchema.statementName; | |||
} | } | |||
// timeouts | // timeouts | |||
class TimeoutManager { | class TimeoutManager { | |||
volatile int currentTimeout; | volatile int currentTimeout; | |||
volatile long checkTimestampSCN; | volatile long checkTimestampSCN; | |||
volatile long checkTimestamp; | volatile long checkTimestamp; | |||
synchronized void startTimeout(int timeout) { | synchronized void startTimeout(int timeout) { | |||
if (timeout == 0) { | if (timeout == 0) { | |||
return; | return; | |||
} | } | |||
End of changes. 9 change blocks. | ||||
10 lines changed or deleted | 30 lines changed or added |