Search found 32 matches

by dqrest
Thu 19 May 2022 06:06
Forum: dotConnect for Oracle
Topic: Connection problems in Advanced Queueing
Replies: 1
Views: 14235

Connection problems in Advanced Queueing

I have devart oracle .Net Connect 9.14.1234 and Oracle Database 12c Enterprise Edition Release 12.2.0.1.0.
Then I copy the simple code "A Simple Example of Point-to-Multipoint Messaging" from
"https://www.devart.com/dotconnect/oracl ... #simpleptp"
that uses Oracle Advanced Queueing.
I have ASP.Net application which is deployed in IIS 10. Note that IIS and Oracle server are used in the difference nets.
If I use dequeueing messages by OnMessage callback, than there is no any subsription registrations in the oracle table DBA_SUBSCR_REGISTRATIONS, and the callback OnMessage is not triggered. Moreover, the ASP.Net application does not throw any exception.
But if IIS and Oracle Server is served in the same net, then OnMessage is performed.

So I have two questions:
1) How to perform OnMessage in case of deploying IIS and Oracle server in the difference nets.
2) Should devart team throw any exception if there is no opportunities to register subscriptions for the OnMessge callback in the table DBA_SUBSCR_REGISTRATIONS?

Thanks.
by dqrest
Fri 14 Jan 2022 10:24
Forum: dotConnect for Oracle
Topic: How to pass not delivered messages to subscribers.
Replies: 1
Views: 6643

How to pass not delivered messages to subscribers.

Hello!
I use Advanced Queuing Technology and follow to
https://www.devart.com/dotconnect/oracle/docs/aq.html

For example, I have 2 users Bill and Ann. Bill and Ann are subscribed to OracleQueueAdmin .
But Ann is not active, i.e. there is no OracleQueue for Ann to get messages.
Then Bill pass a message to all subscribes, and after 1 minute Ann connect to application and get this not delivered message.

How can I do it?
by dqrest
Wed 12 Jan 2022 08:07
Forum: dotConnect for Oracle
Topic: How to pass message from AO callback to client side page
Replies: 2
Views: 6845

Re: How to pass message from AO callback to client side page

I found out that it is used SignalR to pass these messages.
by dqrest
Tue 11 Jan 2022 10:37
Forum: dotConnect for Oracle
Topic: How to pass message from AO callback to client side page
Replies: 2
Views: 6845

How to pass message from AO callback to client side page

I have asp.net web form application and use Advanced Queuing Technology with the following code:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
{
    var resp = this.Response;
    var msgCallback = new Action<object, OracleQueueMessageEventArgs>((ss, ee) =>
    {
        // How to pass "Hello" to client side?
    	resp.Write("Hello");    	
    });
    var orc = new OracleQueueMessageEventHandler(msgCallback);

    // follow the example https://www.devart.com/dotconnect/oracle/docs/aq.html        
    
    OracleQueue oracleDequeueBob = new OracleQueue("MESSAGE_QUEUE", Entry.Connection);
    oracleDequeueBob.DequeueOptions.Navigation = OracleQueueNavigation.FirstMessage;
    oracleDequeueBob.DequeueOptions.ConsumerName = UserName;
    oracleDequeueBob.AsyncNotification = true;
    oracleDequeueBob.OnMessage += orc;          
}

[WebMethod]
public static void UpdateChat(string text)
{
    var oracleEnqueueQueue = new OracleQueue("MESSAGE_QUEUE", Entry.Connection);
    OracleQueueMessage message2 = new OracleQueueMessage();
    message2.StringPayload = text;
    oracleEnqueueQueue.Enqueue(message2);
}      ​
In the client side I call page method UpdateChat to pass a text to other users.
The function msgCallback is called, but I can not to pass "Hello" to client side because the current HttpContext is lost.
How I can pass some text from server side (C#) to client side?
by dqrest
Mon 10 Jan 2022 07:01
Forum: dotConnect for Oracle
Topic: Compatible dotconnect for Oracle 9.14.1234 and Oracle Database Standard Edition
Replies: 1
Views: 6885

Compatible dotconnect for Oracle 9.14.1234 and Oracle Database Standard Edition

Hello!

I have dotconnect for Oracle 9.14.1234 and Oracle Database Standard Edition with Oracle Database 12c Release 1 (12.1.0.1).
Can I apply Advanced Queuing Technology (https://www.devart.com/dotconnect/oracle/docs/aq.html) by dotconnect for Oracle 9.14.1234 to Oracle Database Standard Edition?
Is there any requirements and restrictions for Advanced Queuing Technology.
by dqrest
Wed 17 Feb 2021 06:43
Forum: dotConnect for Oracle
Topic: How to call procedure of UDT OracleObject
Replies: 2
Views: 3110

How to call procedure of UDT OracleObject

Hello!
I have UDT OracleObject with the following procedure

Code: Select all

member procedure set_item(pitem t_variant_named) is
    xindex integer;
  begin
    check_items;
    xindex := index_of(pitem.name);
    if xindex = -1 then
      items.extend;
      items(items.last) := pitem;
    else
      items(xindex) := pitem;
    end if;
  end;
How to use ExecuteMethod in C#. Could you give me an example, please.

Now I have the following progress:

Code: Select all

        public void SetItem(TVariantNamed tVariantNamed)
        {        
            
            OracleParameterCollection xparams = new OracleParameterCollection()
            {
                new OracleParameter("pItem", OracleDbType.Object, tVariantNamed.OracleObject, ParameterDirection.Input)
            };
            var res = OracleObject.ExecuteMethod(_connection, "SET_ITEM", xparams);
            this.OracleObject = xparams["self"].Value as OracleObject;
        }
 
by dqrest
Tue 16 Feb 2021 10:23
Forum: dotConnect for Oracle
Topic: OCI invalid handle in sending blob to OracleObject
Replies: 2
Views: 3078

OCI invalid handle in sending blob to OracleObject

Hello!
I use the following components:
1) dotConnect for Oracle Professional 9.14.1180
2) MS VS 2019
3) Oracle Client 12c 12.2.0.1.0 x86

Then I call the oracle method to pass blob.

Code: Select all

public void SetItem(TVariantNamed tVariantNamed)
{
      OracleParameterCollection xparams = new OracleParameterCollection()
      {
            new OracleParameter("pItem", OracleDbType.Object, tVariantNamed.OracleObject, ParameterDirection.Input),
      };
      OracleObject.ExecuteMethod(_connection, "SET_ITEM", xparams);
       if (xparams.Contains("self") && xparams["self"].Value as OracleObject != null)
                this.OracleObject = xparams["self"].Value as OracleObject;
}
If tVariantNamed.OracleObject store blob, then I have the error "OCI invalid handle". But, when tVariantNamed.OracleObject store string or numeric data, then there is no any error.
Note that the following code was successfully executed for dotConnect for Oracle Professional 6.60.258 and Oracle Client 12c 12.2.0.1.0 x86:

Code: Select all

public void SetItem(TVariantNamed tVariantNamed)
{
      OracleParameterCollection xparams = new OracleParameterCollection()
      {
            new OracleParameter("pItem", OracleDbType.Object, tVariantNamed.OracleObject, ParameterDirection.Input),
      };
      OracleObject.ExecuteMethod(_connection, "SET_ITEM", xparams);       
}
Note that for obtaining the result in dotConnect for Oracle Professional 9.14.1180 you should find in xparams the "self" parameter, but in dotConnect for Oracle Professional 6.60.258 there is no any necessity.

What happend? How to solve this problem?
Thanks!
by dqrest
Thu 19 Nov 2020 05:58
Forum: dotConnect for Oracle
Topic: Get error "License not found..." in the wpf application
Replies: 2
Views: 2747

Get error "License not found..." in the wpf application

Hello, I followed the official instruction of licensing the application (https://www.devart.com/dotconnect/oracl ... nsing.html).
I get the error "License not found..." in the wpf application, but at the same time there is no this error in the asp.net web application.

Now I give the algorithm of compilation.

1) open cmd window and locate to some folder "A"
2) add the file "Devart.Data.Oracle.dll" to the folder "A"
3) add the file "licenses.licx" with the content "Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle" to the folder "A"
4) add the file "licenses.config" with the content "Wpf.exe Asp.dll" (each application is placed in the new line)
5) execute the command "lc /complist:licenses.licx /target:App_License /i:Devart.Data.Oracle.dll /outdir:." in the folder "A"
6) add the generated file "app_license.licenses" to wpf and asp.net applications as a embedded resource.

After launching asp.net web application there is no any error, but in the wpf application I catch the error "License not found...". Note that I use dotConnect for Oracle Professional 9.13.1098.
How to solve this problem?
by dqrest
Wed 28 Oct 2020 11:02
Forum: dotConnect for Oracle
Topic: Obtain data from db.Query<T> as IQuerable<object>
Replies: 1
Views: 1913

Re: Obtain data from db.Query<T> as IQuerable<object>

Find the following solution.

Code: Select all

 public static IQueryable Query(DataContext context, Type type, string sql)
 {
            var method = context?.GetType()?.GetMethods()?.FirstOrDefault(m => m.Name == "Query" && m.IsGenericMethod);
            if (method == null) return null;
           return method.MakeGenericMethod(type)?.Invoke(context, new[] {sql, (object) null }) as IQueryable;
 }
by dqrest
Tue 27 Oct 2020 13:14
Forum: dotConnect for Oracle
Topic: Obtain data from db.Query<T> as IQuerable<object>
Replies: 1
Views: 1913

Obtain data from db.Query<T> as IQuerable<object>

Hello!

I have queries wich are generated for many pages with different classes by the custom builder. That's why I want to execute a query directly with any type. How can I do it in dotConnect for Oracle 9.13.1098.0?

For example, for query "select name, id from test"
I have to create the class

Code: Select all

public class TestName 
{
   public string name {get; set;}
   public int id {get;set;}
}

and execute the code

Code: Select all

var query = db.Query<TestName>("select name, id from test")
But I have many queries and classes and there is no opportunity to create all classes in C#.
How can I execute this query and obtain the result as IQuerable<object>?
Note that after using

Code: Select all

var query = db.Query<object>("select name, id from test")
I have IQuerable<object> but in the item there is no any data.
by dqrest
Wed 14 Oct 2020 06:36
Forum: dotConnect for Oracle
Topic: Invalid casting Primary and Foreign Keys after using ROWID as a primary keys
Replies: 3
Views: 3262

Re: Invalid casting Primary and Foreign Keys after using ROWID as a primary keys

The problem has been solved by adding ThisKey and OtherKey in all association attributes. Thanks!
by dqrest
Tue 13 Oct 2020 12:01
Forum: dotConnect for Oracle
Topic: Invalid casting Primary and Foreign Keys after using ROWID as a primary keys
Replies: 3
Views: 3262

Re: Invalid casting Primary and Foreign Keys after using ROWID as a primary keys

The problem is apperead as follows.
The class TdfField has a foreign key from the field "BlockNo" to the primary key "RowId" of the class "TdfBlock".
by dqrest
Mon 12 Oct 2020 13:02
Forum: dotConnect for Oracle
Topic: Invalid casting Primary and Foreign Keys after using ROWID as a primary keys
Replies: 3
Views: 3262

Invalid casting Primary and Foreign Keys after using ROWID as a primary keys

Hello!

I have dotConnect for Oracle 9.13.1098 (trial).
In order to avoid of using nullable values in primary key fields I add ROWID as a primary key, but I have problems in assosiations between child and parent entites. Namely, there are problems in casting System.Int64 to System.String.

I have two classes in C#:

Code: Select all

[Table(Name = "TABLE1")]
    public class TdfBlock
    {
        long _No;
        //[Column(Name = "NO", Storage = "_No", IsPrimaryKey = true)]
        [Column(Name = "NO", Storage = "_No")]
        public long No { get { return _No; } }

        string _Rowid;
        [Column(Name = "ROWID", Storage = "_Rowid", IsPrimaryKey = true)]
        public string Rowid { get { return _Rowid; } }
        

        EntitySet<TypeTreeMapping.BaseClasses.Kernel.T51.TdfField> _ES_TdfFields_BlockNo = new EntitySet<TypeTreeMapping.BaseClasses.Kernel.T51.TdfField>();       
        [Association(OtherKey = "BlockNo", Storage = "_ES_TdfFields_BlockNo")]
        public EntitySet<TypeTreeMapping.BaseClasses.Kernel.T51.TdfField> ES_TdfFields_BlockNo { get { return _ES_TdfFields_BlockNo; } }
    }

Code: Select all

 [Table(Name = "TABLE2")]
    public class TdfField
    {
        //long _No;
        ////[Column(Name = "NO", Storage = "_No"]
        //[Column(Name = "NO", Storage = "_No", IsPrimaryKey = true)]
        //public long No { get { return _No; } }

        string _Rowid;
        [Column(Name = "ROWID", Storage = "_Rowid", IsPrimaryKey = true)]
        public string Rowid { get { return _Rowid; } }

        long? _BlockNo;
        ///<summary>Номер блока, в котором содержится поле</summary>
        [Column(Name = "BLOCK_NO", Storage = "_BlockNo")]
        public long? BlockNo { get { return _BlockNo; } }

        
        EntityRef<TypeTreeMapping.BaseClasses.Kernel.T50.TdfBlock> _ER_BlockNo_50;       
        [Association(ThisKey = "BlockNo", Storage = "_ER_BlockNo_50")]
        public TypeTreeMapping.BaseClasses.Kernel.T50.TdfBlock E_BlockNo_50
        {
            get
            {                
                return _ER_BlockNo_50.Entity;
            }
        }
    }
After getting the property E_BlockNo_50 in the class TdfField I have the error "Не удалось привести тип объекта "System.Int64" к типу "System.String".".

Has anybody solves this problem?