André Ziegler (JIRA | 25 Jul 10:34 2014

[FB-Tracker] Created: (DNET-561) Add ETW logging support to the provider to get better error logging and have a way to trace the performance of the .Net provider

Add ETW logging support to the provider to get better error logging and have a way to trace the performance of
the .Net provider
--------------------------------------------------------------------------------------------------------------------------------

                 Key: DNET-561
                 URL: http://tracker.firebirdsql.org/browse/DNET-561
             Project: .NET Data provider
          Issue Type: New Feature
          Components: ADO.NET Provider
    Affects Versions: vNext
         Environment: Windows 8, VS2012 Update 4
            Reporter: André Ziegler
            Assignee: Jiri Cincura

With Microsoft.Diagnostics.Tracing.EventSource class
(https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource) there is a great
wrapper for Event Tracing for Windows (ETW -
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363668%28v=vs.85%29.aspx) which
can be easily used to log Events from the provider.

It would be nice if the EF provider would implement ETW events (at start and end of methods which shows how
long a method was executed) to allow perf tracing. It should also be used for logging errors/warnings.

--

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

(Continue reading)

André Ziegler (JIRA | 25 Jul 10:22 2014

[FB-Tracker] Created: (DNET-560) Firebird .Net Provider Installer doesn't remove entries from the machine.config <DbProviderFactories> when removing/repair the provider

Firebird .Net Provider Installer doesn't remove entries from the machine.config
<DbProviderFactories> when removing/repair the provider
---------------------------------------------------------------------------------------------------------------------------------------

                 Key: DNET-560
                 URL: http://tracker.firebirdsql.org/browse/DNET-560
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 4.2.0.0
         Environment: Windows 8, VS2012 Update 4
            Reporter: André Ziegler
            Assignee: Jiri Cincura
            Priority: Critical

The Installer has some issues with the machine.config file. When you remove and older provider, the config
settings for Firebird under <DbProviderFactories> are still left in the config. 

Wen you now install a new FB provider version, a 2nd entry is added. This caused VS crashes for me when working
with DDEX provider when trying to do Reverse Engineering a DB to EDMX Model. Also, when you repair the
provider, a second entry is added. Also the structure of the XML config is corrupted, when the other entry
is added and this causes that other providers like SQL CE fail to load.

Removing all the bad entries fixes both VS issues (crash and SQL CE errors).

--

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
(Continue reading)

Geolffrey Mena (JIRA | 22 Jul 19:03 2014

[FB-Tracker] Created: (DNET-559) Null reference exception on fbcommand dispose in NET CF 3.5

Null reference exception on fbcommand dispose in NET CF 3.5
-----------------------------------------------------------

                 Key: DNET-559
                 URL: http://tracker.firebirdsql.org/browse/DNET-559
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 2.5.2
         Environment: Compact Framework 3.5
            Reporter: Geolffrey Mena
            Assignee: Jiri Cincura

My application is crashing and returning the following errors:

System.NullReferenceException was unhandled
  Message="NullReferenceException"
  StackTrace:
       at FirebirdSql.Data.FirebirdClient.FbCommand.RollbackImplicitTransaction()
       at FirebirdSql.Data.FirebirdClient.FbCommand.Release()
       at FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean disposing)
       at System.ComponentModel.Component.Finalize()

I realize this happen only when the application is trying to save (update/insert).

I have review this tracker system trying to find a solution and I found the bug was fixed in the version 2.7.7.
Which after some test does not work with Compact Framework 3.5. Is there any compiled version for Compact
Framework or can any of you can give some advise about what I need to do in order to make it work with NET CF 3.5.

Thanks in advanced.
(Continue reading)

LtColRDSChauhan | 7 Jul 15:43 2014
Picon

Connecting to Firebird 3.0 Alpha 2

Hi,

1.  I attempted to migrate from Firebird 3.0 Alpha 1 to Alpha 2.  After a backup / restore I'm not able to connect to the database using .NET Provider.  I've the following updated in the Firebird Config file :

UserManager = Legacy_UserManager

AuthClient = Srp, Win_Sspi, Legacy_Auth


2.  FlameRobin connects fine.

3.  Please help.

Regards,
Lt Col RDS Chauhan
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Mark Rotteveel | 6 Jul 10:28 2014
Picon

Re: Scale Precision 4 Truncates to 2 in Database

On 6-7-2014 01:14, mark@... wrote:
> Your parameter is DECIMAL(18,2). If you want scale 2, specify that.

That should of course have read "If you want scale 4, specify that".

Mark

--

-- 
Mark Rotteveel

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Muthu Annamalai | 6 Jul 00:46 2014
Picon

Scale Precision 4 Truncates to 2 in Database

Hi,
I am using Provider 4.2.0.0 and EF 6.0.0.0 in VS 2012. 
When I update a value with 4 digit precision as 1.9999, the value in
database is saved as 1.99. The last 2 digits got truncated. 
I really want 4 digit precision. Any help is appreciated.

In database table the field is set to a domain, which is

CREATE DOMAIN DECIMAL4 AS
NUMERIC(15,4)
DEFAULT 0
NOT NULL;

On submit changes from Visual Studio , the output from the provider is

FirebirdSql.Data.FirebirdClient Information: 0 : Command:
EXECUTE BLOCK (
p0 DECIMAL(18,2) =  <at> p0, p1 INT =  <at> p1
) RETURNS (
"DESCRIPTION" BLOB SUB_TYPE TEXT)
AS BEGIN
UPDATE "ITEMSTYLE"
SET "PRICE" = :p0
WHERE ("ID" = :p1)
RETURNING "DESCRIPTION" INTO :"DESCRIPTION";
SUSPEND;
END

Parameters:
Name: <at> p0	Type:Decimal	Used Value:1.9999
Name: <at> p1	Type:Integer	Used Value:19191

Thanks,
Annam

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Andrew (JIRA | 3 Jul 08:18 2014

[FB-Tracker] Created: (DNET-558) FbCommand with CommandTest containing "EXECUTE BLOCK" will not excpet input FbParamaters

FbCommand with CommandTest containing "EXECUTE BLOCK" will not excpet input FbParamaters
----------------------------------------------------------------------------------------

                 Key: DNET-558
                 URL: http://tracker.firebirdsql.org/browse/DNET-558
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 4.2.0.0
         Environment: VS2013 .NET 4.0
            Reporter: Andrew
            Assignee: Jiri Cincura

When using a FbCommand object to execute a command which contains one or more FbParamters causes a FirebirdSql.Data.Common.IscException.
Below is details of how to reproduce as well as a fix.
Can someone please check that this problem is in fact a real problem (i.e. perhaps there is a way to already do
this). IF it is a bug, is the fixed code blow (towards end of this post) OK.

Exception details:
FirebirdSql.Data.Common.IscException occurred
  _HResult=-2146233088
  HResult=-2146233088
  IsTransient=false
  Message=Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, column 35

Steps to reproduce:
1) Create a table to hold the example data:
CREATE TABLE ADDRESS (ADDRESSID INTEGER NOT NULL, STREET VARCHAR(50), LAST_MOD DATE);

2) Executing the following via a FbCommand object. Note that work as expected.
EXECUTE BLOCK AS
DECLARE VARIABLE ADDRESSID INT = 8;
DECLARE VARIABLE STREET VARCHAR(50) = 'Fred';
DECLARE VARIABLE LAST_MOD DATE = '2014-07-03 13:37:59';
BEGIN
    IF (EXISTS(SELECT ADDRESSID FROM ADDRESS WHERE ADDRESSID = :ADDRESSID)) THEN
        UPDATE ADDRESS SET STREET = :STREET, LAST_MOD = :LAST_MOD WHERE ADDRESSID = :ADDRESSID AND LAST_MOD < :LAST_MOD;
    ELSE
        INSERT INTO ADDRESS(ADDRESSID, STREET, LAST_MOD) VALUES(:ADDRESSID, :STREET, :LAST_MOD);
END;

3) Executing the following via a FbCommand object and use FbParamters to pass in variables.
EXECUTE BLOCK AS
DECLARE VARIABLE ADDRESSID INT =  <at> X;
DECLARE VARIABLE STREET VARCHAR(50) =  <at> Y;
DECLARE VARIABLE LAST_MOD DATE =  <at> Z;
BEGIN
    IF (EXISTS(SELECT ADDRESSID FROM ADDRESS WHERE ADDRESSID = :ADDRESSID)) THEN
        UPDATE ADDRESS SET STREET = :STREET, LAST_MOD = :LAST_MOD WHERE ADDRESSID = :ADDRESSID AND LAST_MOD < :LAST_MOD;
    ELSE
        INSERT INTO ADDRESS(ADDRESSID, STREET, LAST_MOD) VALUES(:ADDRESSID, :STREET, :LAST_MOD);
END;

C# Code below is a working example of the bug.

            string connectionString = "[Insert valid connection strign here]";
            connection = new FbConnection(connectionString);
            connection.Open();

            string sql = "EXECUTE BLOCK AS\r\n " +
                "DECLARE VARIABLE ADDRESSID INT =  <at> X;\r\n" +
                "DECLARE VARIABLE STREET VARCHAR(50) =  <at> Y;\r\n" +
                "DECLARE VARIABLE LAST_MOD DATE =  <at> Z;\r\n" +
                "BEGIN\r\n" +
                "    IF (EXISTS(SELECT ADDRESSID FROM ADDRESS WHERE ADDRESSID = :ADDRESSID)) THEN\r\n" +
                "        UPDATE ADDRESS SET STREET = :STREET, LAST_MOD = :LAST_MOD WHERE ADDRESSID = :ADDRESSID AND LAST_MOD <
:LAST_MOD;\r\n" +
                "    ELSE\r\n" +
                "        INSERT INTO ADDRESS(ADDRESSID, STREET, LAST_MOD) VALUES(:ADDRESSID, :STREET, :LAST_MOD);\r\n" +
                "END;";

            FbCommand fbCommand = new FbCommand(sql, connection);

            FbParameter fbParameter = new FbParameter(" <at> X", FbDbType.Integer);
            fbParameter.Value = 5;
            fbCommand.Parameters.Add(fbParameter);

            fbParameter = new FbParameter(" <at> Y", FbDbType.VarChar);
            fbParameter.Size = 50;
            fbParameter.Value = "Fred";
            fbCommand.Parameters.Add(fbParameter);

            fbParameter = new FbParameter(" <at> Z", FbDbType.Date);
            fbParameter.Value = DateTime.Now;
            fbCommand.Parameters.Add(fbParameter);

            fbCommand.ExecuteNonQuery();

4) The below is a fix. Can someone please check that it is OK?
Edit the following source file: $\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbCommand.cs
See if block following comments "Work around for "EXECUTE BLOCK" with FbParameters."

		private void Prepare(bool returnsSet)
		{
			LogCommand();

			FbConnectionInternal innerConn = this.connection.InnerConnection;

			// Check if	we have	a valid	transaction
			if (this.transaction == null)
			{
				if (innerConn.IsEnlisted)
				{
					this.transaction = innerConn.ActiveTransaction;
				}
				else
				{
					this.implicitTransaction = true;
					this.transaction = new FbTransaction(this.connection, this.connection.ConnectionOptions.IsolationLevel);
					this.transaction.BeginTransaction();

					// Update Statement	transaction
					if (this.statement != null)
					{
						this.statement.Transaction = this.transaction.Transaction;
					}
				}
			}

			// Check if	we have	a valid	statement handle
			if (this.statement == null)
			{
				this.statement = innerConn.Database.CreateStatement(this.transaction.Transaction);
			}

			// Prepare the statement if	needed
			if (!this.statement.IsPrepared)
			{
				// Close the inner DataReader if needed
				this.CloseReader();

				// Reformat the SQL statement if needed
				string sql = this.commandText;

				if (this.commandType == CommandType.StoredProcedure)
				{
					sql = this.BuildStoredProcedureSql(sql, returnsSet);
				}

				try
				{
                    //Work around for "EXECUTE BLOCK" with FbParameters.
                    if (sql.ToUpper().StartsWith("EXECUTE BLOCK") && sql.ToUpper().Contains("DECLARE VARIABLE") &&
this.parameters.Count > 0)
                    {
                        sql = this.SubstituteParameters(sql);
                    }

                    // Try to prepare the command
					this.statement.Prepare(this.ParseNamedParameters(sql));
				}
				catch
				{
					// Release the statement and rethrow the exception
					this.statement.Release();
					this.statement = null;

					throw;
				}

				// Add this	command	to the active command list
				innerConn.AddPreparedCommand(this);
			}
			else
			{
				// Close statement for subsequently	executions
				this.Close();
			}
		}

New code...
        private string SubstituteParameters(string sql)
        {
            string sqlCommand = sql;
            for (int i = 0; i < this.parameters.Count; i++)
            {
                FbParameter fbParameter = this.parameters[i];
                if (fbParameter.Value == null)
                {
                    sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, "NULL");
                }
                else
                {
                    switch (fbParameter.FbDbType)
                    {
                        case FbDbType.BigInt:
                            long longValue = (long)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, longValue.ToString());
                            break;

                        case FbDbType.Boolean:
                            bool boolValue = (bool)fbParameter.Value;
                            string boolStringValue = "0";
                            if (boolValue)
                            {
                                boolStringValue = "1";
                            }
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, boolStringValue);
                            break;

                        case FbDbType.Char:
                        case FbDbType.Text:
                        case FbDbType.VarChar:
                            string strValue = (string)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, "'" + strValue.Replace("'", "''") + "'");
                            break;

                        case FbDbType.Date:
                        case FbDbType.Time:
                        case FbDbType.TimeStamp:
                            DateTime dateValue = (DateTime)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, "'" + dateValue.ToString("yyyy-MM-dd
HH:mm:ss") + "'");
                            break;

                        case FbDbType.Decimal:
                            decimal decValue = (decimal)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, decValue.ToString());
                            break;

                        case FbDbType.Double:
                            double dblValue = (double)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, dblValue.ToString());
                            break;

                        case FbDbType.Float:
                            float floatValue = (float)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, floatValue.ToString());
                            break;

                        case FbDbType.Guid:
                            Guid guid = (Guid)fbParameter.Value;
                            string guidString = "CHAR_TO_UUID('" + guid.ToString() + "')";
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, guidString.ToString());
                            break;

                        case FbDbType.Integer:
                            int intValue = (int)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, intValue.ToString());
                            break;

                        case FbDbType.Numeric:
                            double numValue = (double)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, numValue.ToString());
                            break;

                        case FbDbType.SmallInt:
                            short shtValue = (short)fbParameter.Value;
                            sqlCommand = sqlCommand.Replace(fbParameter.ParameterName, shtValue.ToString());
                            break;

                        default:
                            throw new NotImplementedException("Parameter of " + fbParameter.FbDbType.ToString("G") + " not
implemented in 'EXECUTE BLOCK' commands.");

                    }
                }

            }
            return sqlCommand;
        }

--

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Scott Morgan | 27 Jun 18:09 2014
Picon

FbEmbed Not Releasing Database

Trying to drop a DB opened with the embedded system, but something seems
to be holding the file open after the connection is closed.

Test case from a console app:

Console.WriteLine("Attempting to open DB...");
var conn = new FbConnection();
conn.ConnectionString = myConnectionString;
conn.Open();

Console.WriteLine("Attempting to close DB...");
conn.Close();

conn = null;
GC.Collect();	// Getting desperate here

Console.WriteLine("Attempting to delete DB...");
FbConnection.DropDatabase(ConnectionString);
// File.Delete(DBPath); // doesn't work either

Scott

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Scott Morgan | 25 Jun 16:19 2014
Picon

Re: Backup/Restore Results?

On 25/06/14 14:50, Jiri Cincura wrote:
> You need to use Verbose = true. :\

Ah yes, it throws a relevant exception now. Thanks.

Scott

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Scott Morgan | 25 Jun 15:04 2014
Picon

Backup/Restore Results?

How do you determine if a backup or restore has succeeded?

e.g. (trying to restore from non-existent file)

var restore = new FbRestore();

... set ConnectionString etc...

restore.BackupFiles.Add(
	new FbBackupFile("C:\I\Do\Not\Exist.fbk", null) );
...
restore.Execute();

Runs without throwing an exception and Execute doesn't return any value
to check.

Scott

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Rand Random (JIRA | 24 Jun 17:31 2014

[FB-Tracker] Created: (DNET-557) Cannot create new Model from DataBase

Cannot create new Model from DataBase
-------------------------------------

                 Key: DNET-557
                 URL: http://tracker.firebirdsql.org/browse/DNET-557
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider, Entity Framework support
    Affects Versions: 4.2.0.0
         Environment: Win 7, EF 6.1.1, Firebird 2.5, .Net Provider 4.2.0.0
            Reporter: Rand Random
            Assignee: Jiri Cincura

I am in the middle of the Add Entity Model to your Project on the page where you would choose your tables,
stored procedure and stuff.
Sadly I cannot pick a thing because I am getting the following message:

An error occured while connecting to the database. The database might be unavailable. An exception of type
'System.Data.Entity.Core.EntityCommandCompilationException' occured. The error message is: 'An
error occured while preparing the command definition. See the inner exception for details.
The inner exception caught was of type 'System.Data.Entity.Core.MappingException', with this error
message: 'StoreSchemaMappingVersion3(3,4): error 3027: No mapping specified for the following
EntitySet/AssociationSet - 
FunctionReturnTableColumns,
FunctionFunctionReturnTableColumns'.'.

If you need further Information pls say so, thx for your time and help.

--

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft

Gmane