Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dotnet/DotNetStandardClasses.sln
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GxXsl", "src\dotnetcore\GxXsl\GxXsl.csproj", "{30E7E437-F9B0-42B8-9144-A8E8F972B462}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mocking", "mocking", "{5045873B-E7CF-4317-94C1-0EF8623D23FA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8E5A25F9-2D64-4742-8227-2A3C5816AFEC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MockDBAccess", "src\extensions\mocking\src\MockDBAccess\MockDBAccess.csproj", "{8D05D621-3DB3-459F-8665-BEA4574F4EFF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C16BD5A9-4412-4B91-BB70-5C88B7AAE675}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestMockDBAccess", "src\extensions\mocking\test\TestMockDBAccess\TestMockDBAccess.csproj", "{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -462,6 +472,14 @@ Global
{30E7E437-F9B0-42B8-9144-A8E8F972B462}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30E7E437-F9B0-42B8-9144-A8E8F972B462}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30E7E437-F9B0-42B8-9144-A8E8F972B462}.Release|Any CPU.Build.0 = Release|Any CPU
{8D05D621-3DB3-459F-8665-BEA4574F4EFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D05D621-3DB3-459F-8665-BEA4574F4EFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D05D621-3DB3-459F-8665-BEA4574F4EFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D05D621-3DB3-459F-8665-BEA4574F4EFF}.Release|Any CPU.Build.0 = Release|Any CPU
{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -552,6 +570,11 @@ Global
{B59F76D8-FDB2-4F51-89DB-F15E9BDFF1DC} = {420E8A4A-11D9-42E9-BFB7-4325EA7330B8}
{D97E17A4-C945-4BF3-957E-F73142C4C6D0} = {947E032A-C385-4586-96E3-FC7D2767F082}
{30E7E437-F9B0-42B8-9144-A8E8F972B462} = {2261B65E-3757-4E5B-9DCD-EAE8D1E236A3}
{5045873B-E7CF-4317-94C1-0EF8623D23FA} = {C6AFB6A3-FF0B-4970-B1F1-10BCD3D932B2}
{8E5A25F9-2D64-4742-8227-2A3C5816AFEC} = {5045873B-E7CF-4317-94C1-0EF8623D23FA}
{8D05D621-3DB3-459F-8665-BEA4574F4EFF} = {8E5A25F9-2D64-4742-8227-2A3C5816AFEC}
{C16BD5A9-4412-4B91-BB70-5C88B7AAE675} = {5045873B-E7CF-4317-94C1-0EF8623D23FA}
{B01A243D-C012-4BEB-BAA9-E1D9AC1468C8} = {C16BD5A9-4412-4B91-BB70-5C88B7AAE675}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E18684C9-7D76-45CD-BF24-E3944B7F174C}
Expand Down
29 changes: 28 additions & 1 deletion dotnet/src/dotnetframework/GxClasses/Data/GXDataADO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
using GeneXus.Cache;
using GeneXus.Configuration;
using GeneXus.Data.NTier.ADO;
using GeneXus.Diagnostics;
using GeneXus.Management;
using GeneXus.Reorg;
using GeneXus.Services;
using GeneXus.Utils;
using GeneXus.XML;
using GxClasses.Helpers;
using log4net;
using System;
using System.Collections;
Expand Down Expand Up @@ -2394,7 +2397,8 @@ internal void AfterCreateCommand()

public class GxDataStore : IGxDataStore
{
string id;
static readonly ILog log = log4net.LogManager.GetLogger(typeof(GxDataStore));
string id;
IGxConnection connection;
int handle;
GxDataRecord datarecord;
Expand Down Expand Up @@ -2482,6 +2486,29 @@ private void Initialize(IGxDataRecord db, string id, int hnd, IGxContext context
if (cfgBuf.IndexOf(',') > 0)
cfgBuf = cfgBuf.Split(',')[0];
datarecord = getDbmsDataRecord(id, cfgBuf);

if (GXServices.Instance != null)
{
GXService providerService = GXServices.Instance.Get(GXServices.DATA_ACCESS_SERVICE);
if (providerService != null)
{
GXLogging.Debug(log, "Loading DATA_ACCESS_SERVICE: ", providerService.ClassName);
try
{
#if NETCORE
Type type = AssemblyLoader.GetType(providerService.ClassName);
#else
Type type = Type.GetType(providerService.ClassName, true, true);
#endif
datarecord = (GxDataRecord)Activator.CreateInstance(type, datarecord);

}
catch (Exception ex)
{
GXLogging.Error(log, "Error creating CustomDataRecord " + providerService.ClassName, ex);
}
}
}
}
else
{
Expand Down
38 changes: 22 additions & 16 deletions dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public virtual IDataReader GetCacheDataReader(CacheItem item, bool computeSize,
{
return new GxCacheDataReader (item, computeSize, keyCache);
}
public IsolationLevel IsolationLevelTrn
public virtual IsolationLevel IsolationLevelTrn
{
get{ return isolationLevel;}
set { isolationLevel=value;}
Expand All @@ -346,6 +346,12 @@ public abstract GxAbstractConnectionWrapper GetConnection(

public abstract IDbDataParameter CreateParameter(string name, Object dbtype, int gxlength, int gxdec);

public string BuildConnectionStringImpl(string datasourceName, string userId,
string userPassword, string databaseName, string port, string schema, string extra)
{
return BuildConnectionString(datasourceName, userId, userPassword, databaseName, port, schema, extra);
}

protected abstract string BuildConnectionString(string datasourceName, string userId,
string userPassword,string databaseName, string port, string schema, string extra);

Expand Down Expand Up @@ -421,7 +427,7 @@ public virtual void SetParameterBlob(IDbDataParameter parameter, string value, b
SetBinary(parameter, binary);
}

protected virtual void SetBinary(IDbDataParameter parameter, byte[] binary) {
public virtual void SetBinary(IDbDataParameter parameter, byte[] binary) {
parameter.Value = binary;
if (binary != null)
parameter.Size = binary.Length;
Expand Down Expand Up @@ -471,18 +477,18 @@ public virtual void SetTimeout(IGxConnectionManager connManager, IGxConnection c
}
public virtual string SetTimeoutSentence(long milliseconds){ return null;}

public int LockTimeout
public virtual int LockTimeout
{
get{ return m_lockTimeout;}
set{ m_lockTimeout=value;}
}

public int LockRetryCount
public virtual int LockRetryCount
{
get{ return m_lockRetryCount;}
set{ m_lockRetryCount=value;}
}
public string DataBaseName
public virtual string DataBaseName
{
get { return m_dataBaseName; }
set { m_dataBaseName = value; }
Expand Down Expand Up @@ -743,7 +749,7 @@ public virtual DbDataAdapterElem GetDataAdapter(IGxConnection con, string stmt,
}
return adapter;
}
protected virtual DbDataAdapterElem GetCachedDataAdapter(IGxConnection con, string stmt)
public virtual DbDataAdapterElem GetCachedDataAdapter(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetDataAdapter(stmt);
}
Expand All @@ -768,7 +774,7 @@ public virtual IDbCommand GetCommand(IGxConnection con, string stmt, GxParameter
{
return GetCommand(con, stmt, parameters);
}
protected virtual void PrepareCommand(IDbCommand cmd)
public virtual void PrepareCommand(IDbCommand cmd)
{
}
public virtual int GetCommandTimeout()
Expand Down Expand Up @@ -835,12 +841,12 @@ public virtual void DisposeCommand(IDbCommand command)
command.Dispose();
}

protected virtual IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public virtual IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetPreparedCommand(stmt);
}

public string ConnectionString
public virtual string ConnectionString
{
get{ return m_connectionString;}
set{ m_connectionString=value;}
Expand Down Expand Up @@ -933,7 +939,7 @@ protected static byte[] GetBinary(string fileNameParm, bool dbBlob)
}
}

public string DataSource
public virtual string DataSource
{
get {return m_datasource;}
set{m_datasource=value;}
Expand All @@ -952,7 +958,7 @@ public string ConnectionStringForLog()
}
return result;
}
protected virtual bool hasKey(string data, string key)
public virtual bool hasKey(string data, string key)
{
if (!string.IsNullOrEmpty(data) && data.IndexOf(key, StringComparison.OrdinalIgnoreCase) >= 0)
{
Expand All @@ -966,7 +972,7 @@ protected virtual bool hasKey(string data, string key)
}
return false;
}
protected virtual string ParseAdditionalData(string data, string extractWord)
public virtual string ParseAdditionalData(string data, string extractWord)
{
char[] sep = {';'};
StringBuilder res=new StringBuilder("");
Expand All @@ -981,7 +987,7 @@ protected virtual string ParseAdditionalData(string data, string extractWord)
}
return res.ToString();
}
protected virtual string ReplaceKeyword(string data, string keyword, string newKeyword)
public virtual string ReplaceKeyword(string data, string keyword, string newKeyword)
{
char[] sep = { ';' };
StringBuilder res = new StringBuilder("");
Expand All @@ -1006,7 +1012,7 @@ protected virtual string ReplaceKeyword(string data, string keyword, string newK
}
return res.ToString();
}
protected virtual string RemoveDuplicates(string data, string extractWord)
public virtual string RemoveDuplicates(string data, string extractWord)
{
char[] sep = { ';' };
StringBuilder res = new StringBuilder("");
Expand Down Expand Up @@ -1659,7 +1665,7 @@ internal override object CloneParameter(IDbDataParameter p)
{
return ((ICloneable)p).Clone();
}
protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
if (multipleDatareadersEnabled)
{
Expand Down Expand Up @@ -4242,7 +4248,7 @@ public bool Read()
public virtual DateTime GetDateTime(int i)
{
if (computeSizeInBytes) readBytes += 8;
var value = block.Item(pos,i);
object value = block.Item(pos,i);

if (value is DateTime)
return (DateTime)value;
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/dotnetframework/GxClasses/Data/GXDataDb2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ internal override object CloneParameter(IDbDataParameter p)
/* db2400:the same command cannot be executed a second time without first
* close it (it is possible if they are different commands), then if it is cached,
* and it is not closed, it cannot be used, a new one is created*/
protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
10 changes: 5 additions & 5 deletions dotnet/src/dotnetframework/GxClasses/Data/GXDataDb2400.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public override bool GetBoolean(IGxDbCommand cmd, IDataRecord DR, int i)
{
return (base.GetInt(cmd, DR, i) == 1);
}
protected override string ParseAdditionalData(string data,string extractWord)
public override string ParseAdditionalData(string data,string extractWord)
{
char[] sep = {';'};
StringBuilder res=new StringBuilder("");
Expand Down Expand Up @@ -396,7 +396,7 @@ public override void SetParameter(IDbDataParameter parameter, Object value)
}

}
protected override void SetBinary(IDbDataParameter parameter, byte[] binary)
public override void SetBinary(IDbDataParameter parameter, byte[] binary)
{
GXLogging.Debug(log, "SetParameter BLOB, binary.length:" + binary != null ? binary.Length.ToString() : "null");
parameter.Value = binary;
Expand Down Expand Up @@ -594,7 +594,7 @@ internal override object CloneParameter(IDbDataParameter p)
, p.Scale, p.SourceColumn, p.SourceVersion, p.Value});
}

protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down Expand Up @@ -900,7 +900,7 @@ protected override string BuildConnectionString(string datasourceName, string us

}

protected override string ParseAdditionalData(string data, string extractWord)
public override string ParseAdditionalData(string data, string extractWord)
{
char[] sep = { ';' };
StringBuilder res = new StringBuilder("");
Expand Down Expand Up @@ -1116,7 +1116,7 @@ internal override object CloneParameter(IDbDataParameter p)
return ((ICloneable)p).Clone();
}

protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/dotnetframework/GxClasses/Data/GXDataHana.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public override void SetParameter(IDbDataParameter parameter, Object value)
parameter.Value = CheckDataLength(value, parameter);
}
}
protected override void SetBinary(IDbDataParameter parameter, byte[] binary)
public override void SetBinary(IDbDataParameter parameter, byte[] binary)
{
GXLogging.Debug(log, "SetParameter BLOB, binary.length:" + binary.Length);
if (binary != null && binary.Length == 0)
Expand Down Expand Up @@ -277,7 +277,7 @@ public override string GetServerUserIdStmt()
return "CURENT_USER";
}

protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/dotnetframework/GxClasses/Data/GXDataInformix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private object GXTypeToIfxType(GXType type)
}
}

protected override void PrepareCommand(IDbCommand cmd)
public override void PrepareCommand(IDbCommand cmd)
{

}
Expand Down Expand Up @@ -450,7 +450,7 @@ internal override object CloneParameter(IDbDataParameter p)
return ((ICloneable)p).Clone();
}

protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public override IDataReader GetDataReader(
}
return idatareader;
}
protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public override IDataReader GetDataReader(
idatareader = new GxMySQLDriverCSDataReader(connManager, this, con, parameters, stmt, fetchSize, forFirst, handle, cached, expiration, dynStmt, preparedStmts);
return idatareader;
}
protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public override string GetServerUserIdStmt()

}

protected override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
public override IDbCommand GetCachedCommand(IGxConnection con, string stmt)
{
return con.ConnectionCache.GetAvailablePreparedCommand(stmt);
}
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/dotnetframework/GxClasses/Data/GXDataOracle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ public override void SetParameter(IDbDataParameter parameter, Object value)
}

}
protected override void SetBinary(IDbDataParameter parameter, byte[] binary)
public override void SetBinary(IDbDataParameter parameter, byte[] binary)
{
GXLogging.Debug(log, "SetParameter BLOB, binary.length:", () => binary != null ? binary.Length.ToString() : "null");
if (binary != null && binary.Length == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public override long GetBytes(IGxDbCommand cmd, IDataRecord DR, int i, long fiel
}
}
//ByteArrayToByteaTextEscaped
protected override void SetBinary(IDbDataParameter parameter, byte[] byteArray)
public override void SetBinary(IDbDataParameter parameter, byte[] byteArray)
{
if (_byteaOutputEscape)
{
Expand Down
Loading