| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.command.dml; |
| 7 |
|
| 8 |
import org.h2.command.CommandInterface; |
| 9 |
import org.h2.command.Prepared; |
| 10 |
import org.h2.engine.IsolationLevel; |
| 11 |
import org.h2.engine.SessionLocal; |
| 12 |
import org.h2.result.ResultInterface; |
| 13 |
|
| 14 |
/** |
| 15 |
* This class represents the statement SET SESSION CHARACTERISTICS |
| 16 |
*/ |
| 17 |
public class SetSessionCharacteristics extends Prepared { |
| 18 |
|
| 19 |
private final IsolationLevel isolationLevel; |
| 20 |
|
| 21 |
public SetSessionCharacteristics(SessionLocal session, IsolationLevel isolationLevel) { |
| 22 |
super(session); |
| 23 |
this.isolationLevel = isolationLevel; |
| 24 |
} |
| 25 |
|
| 26 |
@Override |
| 27 |
public boolean isTransactional() { |
| 28 |
return false; |
| 29 |
} |
| 30 |
|
| 31 |
@Override |
| 32 |
public long update() { |
| 33 |
session.setIsolationLevel(isolationLevel); |
| 34 |
return 0; |
| 35 |
} |
| 36 |
|
| 37 |
@Override |
| 38 |
public boolean needRecompile() { |
| 39 |
return false; |
| 40 |
} |
| 41 |
|
| 42 |
@Override |
| 43 |
public ResultInterface queryMeta() { |
| 44 |
return null; |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
public int getType() { |
| 49 |
return CommandInterface.SET; |
| 50 |
} |
| 51 |
|
| 52 |
} |