Re: error: System.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when sending the request to the server. (provider: Session Provider, error: 19 - Physical connection is not usable)

Buen dia:
Encontraste  la solución? tengo el mismo problema.

El viernes, 21 de septiembre de 2018, 20:25:42 (UTC-3), gab escribió:


------
========== Run Developer Menu started ==========
========== Copying Module 'GeneXus' started ==========
Copying Module 'GeneXus' Success
========== Pattern generation (Entity Services) started ==========
Pattern generation (Entity Services) Success
========== Pattern generation (Prompt) started ==========
Pattern generation (Prompt) Success
========== Pattern generation (Trn Form) started ==========
Pattern generation (Trn Form) Success
warning: An exception has been thrown on BeforeBuild event: 'A transport-level error has occurred when sending the request to the server. (provider: Session Provider, error: 19 - Physical connection is not usable)'
========== Target Environment update started ==========
Target Environment update Success
Building changed objects list
No objects to Specify
Generating Resources...
error: System.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when sending the request to the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
   at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at Deklarit.Data.SqlBaseHandler.ExecuteReader(IDbCommand command, Boolean external, CommandBehavior behavior)
   at Deklarit.Data.ReadWriteCommand.InternalExecute(CommandBehavior behavior)
   at Deklarit.Data.ReadWriteCommand.ExecuteReader(CommandBehavior behavior)
   at gxioSQL.ModelEntityVersionDataReader.OpenByModelIdEntityTypeId(Int32 modelId, Int32 entityTypeId)
   at Artech.Udm.Layers.Data.SQL.Mappers.ModelEntityVersionMapper.<GetByUdmModel_EntityType>d__16.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Artech.Packages.Generators.Services.GeneratorsService.GenerateResources(KBModel fromModel, KBModel workingModel)
ClientConnectionId:56fa1236-2b40-45b8-9ad6-5dc516829013
Error Number:-1,State:0,Class:20
Failed
========== Default (C# Web) Generation started ==========
Generating to NetSQLServer_SD003\web\gxcfg.js
Generating to NetSQLServer_SD003\web\GXCFG.WEB
Generating to NetSQLServer_SD003\web\client.exe.config
Generating to NetSQLServer_SD003\web\WCFClient.config
Generating to NetSQLServer_SD003\web\bldDevelopermenu.cs
Generating to NetSQLServer_SD003\web\DeveloperMenu.xml
Generating to NetSQLServer_SD003\web\runsets.ini
Generating to NetSQLServer_SD003\web\genexus.programs.common.rsp
Generating to NetSQLServer_SD003\web\exe.bld
Generating to NetSQLServer_SD003\web\winexe.bld
Generating to NetSQLServer_SD003\web\library.bld
Generating to NetSQLServer_SD003\web\bld15.info
Generating to NetSQLServer_SD003\web\DeveloperMenu.xml
Default (C# Web) Generation Success
Compressing static files...Success
========== DeveloperMenu Compilation for Default (C# Web) started ==========
gxexec "D:\KBs\KB15\stjdesa1\NetSQLServer_SD003\web\bldDevelopermenu.cs" -r:GxBaseBuilder.dll -arg:csc="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe"
DeveloperMenu Compilation for Default (C# Web) Success
========== Web config update started ==========
Updating web config ...
Web config update Success
Run Developer Menu Failed

--
Has recibido este mensaje porque estás suscrito al grupo "GeneXus" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a genexus+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

🛫 Grupo Gx - Your flight confirmation for your trip around the world

 

Fasten your seatbelt, Grupo Gx!

 

Join us on a virtual trip around the world. An experience you'll never forget.

 
See booking

Trabajar con Personas, Activas/NoActivas DataProvider

Trabajar con Personas, Activas/NoActivas


.

How To: Examples of Data Providers with Conditions

Learn how to create Data Providers with output with conditions.

In GeneXus X we've incorporated a new type of object called Data Provider. By way of introduction for those who don't know them, Data Providers are declarative objects that replace a certain class of procedures: those that receive an input, perform a process and whose final objective is to return a set of data in a structured format, which means that the focus is placed on the output.

In this way, the format of the Data Provider's output is defined, thus transforming it into a more declarative object than a procedure because the emphasis is on "what" to do instead of "how" to do it.


The basic components of Data Providers are Groups, Elements, Variables, Subgroups and advanced control options for the Groups (Default clause, Paginate clause, NoOutput clause, OutputIfDetail clause and Input clause).

For more details read the Documentation CommunityWiki 

The objective of this How To is to show two interesting examples.

The first one shows that in the groups' Where conditions we can add conditions in which the left side of the comparison can be either an attribute or even variables. 

Let's suppose that we want to obtain a list of employees with their details. In this case, the DP would be as shown below:

EmployeeCollection
{
       EmployeeItem
      {
                    Id = EmployeeId
                    Name = EmployeeDsc
                    Address = EmployeeAddress
       }
}

If we needed to condition the output depending on whether the user is authorized to view this information or not, we could add the following condition:

EmployeeCollection
{
             EmployeeItem
             Where &UsrAut="S" 
             {
                        Id = EmployeeId
                        Name = EmployeeDsc
                        Address = EmployeeAddress
              }
}

In this case, the filter is added to the generated SQL sentence, which would be as follows:

SELECT [EmployeeId], [EmployeeDsc], [EmployeeAddress] FROM [Employee] WITH (NOLOCK) 
WHERE @AV1UsrAut = "S" ORDER BY 
[EmployeeId]

If I wanted to always return this data but display the address to authorized users only, I could write the following: 

EmployeeCollection 
{
           EmployeeItem
          {
                  EmployeeId
                  EmployeeDsc
                  EmployeeAddress [NoOutput]
                  Where &UsrAut="S"
                  {
                            EmployeeAddress = EmployeeAddress;
                            EmployeeSalary = EmployeeSalary;
                   }
           }
}
 
In this case, a select sentence is generated without the filter condition, which is transformed into an IF in the DP source:
 
Select a ejecutar:
SELECT [EmployeeId], [EmployeeDsc], [EmployeeAddress], [EmployeeSalary] 
FROM [Employee] WITH (NOLOCK) 
ORDER BY [EmployeeId]

Y además en el fuente del DP:
if ( AV1UsrAut = "S")
{
Gxm1employee.gxTpr_Employeeaddress = A363Employee ;
Gxm1employee.gxTpr_Employeesalary = A364Employee ;
}

Note: If, instead of a group of attributes (Address, Salary, etc.), we want to filter only one value we can write:
EmployeeAddress = EmployeeAddress if &UsrAut="S"; 

Let's see another interesting example:

Let's suppose that we have an application that handles Clients and Prospects (Clients are in one table and Prospects are in another). We want to write a Data Provider that will return a Collection containing the Active Clients or Prospects. 

The Data Provider will receive as parameter the order of whether to display Clients or Prospects.

Below is one way to write it:

Parm(&FiltrarPor)
 
 
SDTCliProsCollection
{
          SDTCliProsCollectionItem using DSClientesActivos()
          where &FiltrarPor = 'CLIENTE'
          {
                   PartnerId = ClienteId
                   PartnerName = ClienteName
          }
          SDTCliProsCollectionItem using DSProspectsActivos()
          where &FiltrarPor = 'PROSPECT'
          {
                   PartnerId = ProspectId
                   PartnerName = ProspectName
          }
}

DSClientesActivos defines the filter over Clients and DSProspectsActivos does the same in the Prospects table.

Note that this will always execute the two select clauses but will add to the where clause the &FilterBy value received by parameter in the Data Provider (therefore, one of them will return data and the other will not).

This generates the following:

SELECT [ClienteTipo], [ClienteId], [ClienteNombre] FROM [Cliente] WITH (NOLOCK) 
WHERE (@AV4Filtrar = 'CLIENTE') AND 
([ClienteStatus] = "Activo") ORDER BY [ClienteId]

SELECT [ProspectTipo], [ProspectId], [ProspectNombre] FROM [Prospect] WITH (NOLOCK) 
WHERE (@AV4Filtrar = 'PROSPECT') AND 
([ProspectStatus] = "Activo") ORDER BY [ProspectId]

However, we can write the Data Provider as shown below, so that it doesn't always execute the two select clauses, but only the corresponding one according to the  &FiltrarPor parameter (the select to be executed is chosen in the generated source).

SDTCliProsCollection
{
          SDTCliProsCollectionDummy [NoOutput]
          where &FiltrarPor = 'CLIENTE'
          {
                   SDTCliProsCollectionItem using DSClientesActivos()
                   {
                             PartnerId = ClienteId
                             PartnerName = ClienteNombre
                   }
          }
          SDTCliProsCollectionDummy [NoOutput]
          where &FiltrarPor = 'PROSPECT'
          {
                   SDTCliProsCollectionItem using DSProspectActivos()
                   {
                             PartnerId = ProspectId
                             PartnerName = ProspectNombre
                   }
          }

}

Select clause to execute in the event that the DP is invoked with &FiltrarPor = 'CLIENTE':
 
SELECT [ClienteTipo], [ClienteId], [ClienteNombre] FROM [Cliente] WITH (NOLOCK) 
WHERE [ClienteStatus] = "Activo" ORDER BY [ClienteId]
 
Also, in the Data Provider source:
         if ( ( String.CompareOrdinal(AV4Filtrar.TrimEnd(' '), "CLIENTE".TrimEnd(' ') ) == 0 ) )
         {
            AV10DSClie = AV2Cliente ;
            /* Using cursor P001R2 */
            pr_default.execute(0, new Object[] {AV10DSClie});
            while ( (pr_default.getStatus(0) != 101) )
            {
               ………………………. (select con filtro por [ClienteStatus] = "Activo")
            }
            pr_default.close(0);
         }
         if ( ( String.CompareOrdinal(AV4Filtrar.TrimEnd(' '), "PROSPECT".TrimEnd(' ') ) == 0 ) )
         {
            AV12DSPros = AV3Prospec ;
            /* Using cursor P001R3 */
            pr_default.execute(1, new Object[] {AV12DSPros});
            while ( (pr_default.getStatus(1) != 101) )
            {
               ……………………….(select con filtro por [ProspectStatus] = "Activo")
            }
            pr_default.close(1);
         }

 

         this.cleanup();
.
--
Saludos,
gab
@gxsoft

--
Has recibido este mensaje porque estás suscrito al grupo "GeneXus" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a genexus+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

GeneXus X+ : Reorganization


GeneXus X+ : Reorganization
Database Reorganization cases where a temporary table is created
Official Content

The cases requiring the creation of a temporary table when executing a database reorganization are those that cannot be solved only with SQL statements. The generator used to run the database reorganization will create and execute a conversion program during the reorganization; these reorganizations are detailed here.

You will identify these kind of database reorganizations in the IAR (Impact Analysis Report); for these cases a temporary table will be created and a GeneXus program or SQL statement will be used to copy the data to the new structures.

Each table conversion will generate a <TableName>conversion file detailing the following:

CREATE TABLE [GXA0001] ( .... )  Run conversion program for table <TableName>  DROP TABLE [<TableName>]  CALL sp_rename('[GXA0001]', '<TableName>')  ALTER TABLE [<TableName>] ....

Note: in this case the database reorganization sample is associated to SQLServer, you will notice some differences when executing with other DBMS.
In short the database reorganization does the following:

  • A temporary table GXA0001 is created with the new table structure.
  • A conversion program is executed to populate the temporary structure.
  • The old table "Tablename" is deleted.
  • The temporary table is renamed with the correct "TableName".
  • The table restrictions are set.

The generator will create and execute the conversion program during the database reorganization using the following pattern for each table:

<TableName>conversion.cs for C# generator.
<TableName>conversion.java for Java generator.
<TableName>conversion.rb for Ruby generator.

Samples

1. Adding a BLOB attribute to a transaction (using SQLServer until version X Evolution 2 upgrade 3)

Note: Since version X Evolution 2 Upgrade 3, this reorg has been optimized, and an "Alter table" is used instead of creating a temporal table (see SAC #32631 for more information) 

CREATE TABLE [GXA0001] (    [Transaction1Id]       SMALLINT     NOT NULL,    [Transaction1Num]   SMALLINT     NOT NULL,    [Transaction1Blob]     VARBINARY(MAX)     NOT NULL)    Run conversion program for table Transaction1    DROP TABLE [Transaction1]    CALL sp_rename('[GXA0001]', 'Transaction1')    ALTER TABLE [Transaction1]  ADD     PRIMARY KEY ( [Transaction1Id] )

2. Adding a Longvarchar attribute to a transaction (using SQLServer until version X Evolution 2 Upgrade 3)

Note: Since version X Evolution 2 Upgrade 3, this reorg has been optimized, and an "Alter table" is used instead of creating a temporal table (see SAC #32631 for more information) 

CREATE TABLE [GXA0001] (    [Transaction1Id]     SMALLINT     NOT NULL,    [Transaction1Num]    SMALLINT     NOT NULL,    [Transaction1LongVC] VARCHAR(MAX)     NOT NULL)    INSERT INTO [GXA0001]             ([Transaction1Id],              [Transaction1Num],              [Transaction1LongVC])  SELECT [Transaction1Id],         [Transaction1Num],         ''  FROM   [Transaction1] T1    DROP TABLE [Transaction1]    DROP TABLE [Transaction1]    CALL sp_rename('[GXA0001]', 'Transaction1')    ALTER TABLE [Transaction1]  ADD     PRIMARY KEY ( [Transaction1Id] )

3. Altering the key of the table, when any other field accepts nulls of the DBMS.

When the key of the table Transaction1 wants to be modified (for example changing a N(5) to a N(6)), an alter table cannot be performed. In this case, a temporary table is created, and the data is copied to the temporary table in an optimized way:

INSERT INTO GXA0001 (a, b, c) SELECT a, b, c FROM Transaction1

If the table Transaction1 has any attribute which has Nullable property - Attribute = TRUE, this optimization cannot be done so the copy is done defining a cursor for querying the data from one table (Transaction1) and another cursor for inserting in the other table.

4. The size of a character attribute is changed to a minor one

For example if there is an attribute, and its type is Char(60), and the reorg consists in changing it to Char(40), a temporary table is created. The script is as follows:

CREATE TABLE [GXA0001] (    [TrnCharactersId]          SMALLINT     NOT NULL,    [TrnCharactersChar60To40]  CHAR(40)     NOT NULL)    Run conversion program for table TrnCharacters  DROP TABLE [TrnCharacters]  CALL sp_rename('[GXA0001]', 'TrnCharacters')  ALTER TABLE [TrnCharacters]   ADD     PRIMARY KEY ( [TrnCharactersId] )

Note: This case was optimized since Salto Beta 1 version.

Others

  • Changing the property nullable from yes to no
  • Case of Informix  - when the rgz0005 is given
  • Case of Oracle  - when more than a table is navigated to load data of a table
  • Case of Informix - when the table to be loaded have to navigate itself
--
Saludos,
gab
@gxsoft

--
Has recibido este mensaje porque estás suscrito al grupo "GeneXus" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a genexus+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

KB Versions

.
.

Knowledge Base Versions

An application life cycle has several milestones called Versions in GeneXus. A Version holds the status of an application at any given time. It may be a read-only version holding a "photo" of the application at any important time during development. Common names for read-only versions are: Sent to QA, Version 1.0 final, Version 2 as installed in customer X. Versions may also represent separate development threads, sample version names in this case may be, for example: Fixes to QA version, Upgrades to Version 1.0 final,  Hot fixes to Version 2 as installed in customer X.

Having versions of an application in a Knowledge Base targets the following scenarios:

  • Separating development threads.

Being able to continue application development while fixing other version(s) without disrupting each other.

  • Analyzing changes between application versions

Easily comparing versions, moving changes from one to another, etc.

  • Restoring to a previously known state

Versions can be used to make a backup of your applications before making "what if" changes.

  • Basic application customization

Even though versions are not the ideal method for customization, they can be used for this purpose in some situations.

A typical development process

Every new Knowledge Base has a default development version. Opening the Knowledge Base Versions tool window shows this default version, which has the name of the Knowledge Base. Development starts on this version, and it continues until you decide that the desired level of functionality and stability has been reached, and it's time to release your work to customers.

Knowledge Base Versions - Default development version

At release time, it is a good idea to make a copy of your application as it is released. This is called "Freezing" a version and the result is a Frozen version. Right clicking on the default version node shows the Freeze option. Selecting the Freeze option prompts you for the name and description that will be assigned to the new Frozen version. Default values are good enough at this time, so let GeneXus create your new Frozen version, "Version 1".

Knowledge Base Versions - First Freeze

Having created a frozen version, you can switch between them (right click on any of them and set it to Active) and perform the following actions:

  • Continue application development on the next release
  • See exactly what was released as of "Version 1"
  • Compare both versions

Fixing the "Version 1" version

The "Version 1" version is a Frozen version. It cannot be changed. If you need to fix it, you must create a new version. Right click on "Version 1" and select the New Version option. Leave the default names and description and create the new version. The new version "Upgrades for Version 1" is an exact copy of what was released on "Version 1".

Knowledge Base Versions - New development version

Now the diagram shows three versions, one of them is Frozen. Set the "Upgrades for Version 1" to active (Set as Active on context menu). From then on, any change you make in objects, or any objects created or removed willgo to "Upgrades for Version 1". Other versions will not be affected.

Knowledge Base Versions - Upgrades for Version 1 Active

When you've made all the fixes to "Upgrades for Version 1", it's time to release. Once again, select the Freeze option on "Upgrades for Version 1" in the context menu. Leave the default names for the new Frozen version.

Knowledge Base Versions - Freeze Upgrades for Version 1

At this time you are able to:

  • Continue application development on the next release
  • See exactly what was released as of "Version 1"
  • Regenerate the application as of "Version 1"
  • Continue adding fixes to "Version 1" (changing "Upgrades to Version 1")
  • See exactly what was released as of "Version 1.1" (fixes for "Version 1")
  • Regenerate the application as of "Version 1.1"
  • Compare any versions

Various fix sets for "Version 1" version

While not desirable, sometimes it is necessary to create a separate development thread just to make specific fixes. The most common example is having two customers experiencing different problems. When the first problem arises, you create the "Upgrades for Version 1" version and fix it as described above. Later, the second problem arises in a different customer. This customer accepts the fix to his or her problem, and nothing but that fix (i.e. you cannot fix the problem in "Upgrades for Version 1" as it already has another fix). The solution to this is to create a new version from "Version 1" (select New Version from the "Version 1" context menu) and fix the new problem in this version.

Knowledge Base Versions - Various development versions for a single frozen version

Note the horizontal line starting on "Version 1" and linked to "Upgrades for Version 1" and "Upgrades 2 for Version 1"). It states that both versions share a common starting point ("Version 1").

Continue application development

After an application is released, work usually begins on a new version. The most common tasks are adding new features, making major changes, and introducing fixes to existing versions. The new version is not started from scratch, so: where are these changes made? In what version? They are made in the default development version, the one at the top (root) of the Knowledge Base Versions Diagram.

The development cycle continues until your application is ready to be released again. To create a new Frozen version, select the Freeze context menu option of the root node and leave the default names.

Knowledge Base Versions - Continue application development

By now you should've already realized how the cycle works: develop -> freeze -> develop -> freeze ... This cycle applies to any Development Version.

Reading the Knowledge Base Versions Diagram

The Knowledge Base Versions Diagram shows the version hierarchy. Each vertical line is a timeline representing a development thread. Earlier versions in each thread are closer to the top of each vertical line. A horizontal line connects versions sharing a common parent Frozen version.

Frozen versions are displayed as light-brown filled rectangles connected to a vertical line. At the top of this line there is always a Development Version.

Development versions are displayed as rounded rectangles connected to one Frozen version. Many Development versions can be connected to a single Frozen one meaning they all share a common source base.

Knowledge Base Versions - Complex KB Versions Diagram

Version naming convention

Versions can have any name you choose, as long as they are not duplicated. Usually, Frozen version have numbers (1, 2, 3, 1.1, 3.2, etc.) and Development ones are named (code name like Yi, Rocha, Solis, etc.).

Frequently Asked Questions

How do I know what version I'm working on?

The current version is displayed in the Preferences and in the Folder View tool windows as shown in the following image.

Knowledge Base Versions - How do I know in what version am I working on

Comparison with previous GeneXus versions

This section is for GeneXus users that are used to working on versions prior to GeneXus X. The concept of Knowledge Base is a bit different in this version.

Each GeneXus X Version should be considered a Knowledge Base in prior GeneXus versions. A GeneXus X Knowledge Base is, therefore, a set of Knowledge Bases of prior GeneXus versions. A couple of examples may help you understand the concept:

If you want toGeneXus XPrior GeneXus versions
Create a copy of your application at a given milestone. For example, at release timeFreeze a versionCopy Knowledge Base directory to a new one
Continue development for the next versionSet the default development version as activeOpen the development Knowledge Base
Fix a released applicationCreate a (development) Version from the corresponding Frozen one and set it as activeCopy the previous backup directory to a new one
Make a new, separate fix, for released applicationCreate another (development) Version from the corresponding Frozen one and set it as activeCopy the previous backup directory to a new one

 

See Also

Version Properties



--
Saludos,
gab
@gxsoft

--
Has recibido este mensaje porque estás suscrito al grupo "GeneXus" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a genexus+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.