Skip to content

Commit dc569c2

Browse files
committed
Oracle: Attempt to fix transaction serialization error
1 parent 687d18b commit dc569c2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Orm/Xtensive.Orm.Oracle/Sql.Drivers.Oracle/v11/Translator.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,32 @@
66

77
using System;
88
using Xtensive.Sql.Compiler;
9+
using Xtensive.Sql.Ddl;
910

1011
namespace Xtensive.Sql.Drivers.Oracle.v11
1112
{
1213
internal class Translator : v10.Translator
1314
{
15+
//so called INITRANS value
16+
protected const int TableTransactionalParallelismLevel = 3;
17+
protected const int IndexTransactionalParallelismLevel = 3;
18+
19+
public override string Translate(SqlCompilerContext context, SqlCreateTable node, CreateTableSection section)
20+
{
21+
if (section == CreateTableSection.TableElementsExit)
22+
return $") INITRANS {TableTransactionalParallelismLevel} ";
23+
return base.Translate(context, node, section);
24+
}
25+
26+
public override string Translate(SqlCompilerContext context, SqlCreateIndex node, CreateIndexSection section)
27+
{
28+
if (section == CreateIndexSection.ColumnsExit)
29+
return $") INITRANS {IndexTransactionalParallelismLevel}";
30+
//CreateIndexSection.ColumnsExit:
31+
//return ")"
32+
return base.Translate(context, node, section);
33+
}
34+
1435
public override string Translate(SqlValueType type)
1536
{
1637
// we need to explicitly specify maximum interval precision

0 commit comments

Comments
 (0)