Search found 13 matches

by ying515_huang
Wed 06 Jun 2012 10:11
Forum: dotConnect for Oracle
Topic: Can not found Inserted Record?
Replies: 1
Views: 898

Can not found Inserted Record?

We inserted record when it is not SubmitChanges().
user want modify inserted record. but it is not found.

Code: Select all

        public void InsertLines(SmpWipmmtLinesVMeta data)
        {
            try
            {
                DateTime? db_date = db.GetDbSysDate();
                data.WmLineId = Convert.ToDecimal(db.GetWipmmtLinesNextval());
                data.WmHeaderId = this.hd_id;
                SmpWipmmtLinesTp dls = new SmpWipmmtLinesTp();
                copy_data(data, dls);
                db.SmpWipmmtLinesTps.InsertOnSubmit(dls);
                decimal i = 0;
                SmpWipmmtLinesTp target = db.SmpWipmmtLinesTps.Where(p => p.WmLineId == data.WmLineId).FirstOrDefault();
                if (target != null)  <-- why it is always null
                {
                    i = target.WmLineId;
                }
            }
SmpWipmmtLinesTp is database view!

ASP.NET MVC 2.0 & Visual 2010 & framework 4.0
Oracle DB 11
dotConnect Ver 6.10.111.0
by ying515_huang
Wed 24 Aug 2011 02:23
Forum: dotConnect for Oracle
Topic: Table of records as in or out parameter in store procedure?
Replies: 1
Views: 2148

Table of records as in or out parameter in store procedure?

Ca you tell me how I can call that kind of procedure/function with table of records as input or output parameters and make use of it in C# ?

runtime error:"Invalid datatype: TABLE"

we use Linq to Oracle.

screenshoot
https://docs.google.com/leaf?id=0B1l5ui ... 2&hl=zh_TW

Code: Select all

CREATE OR REPLACE TYPE HR.department_type AS OBJECT
(
  DNO NUMBER,
  NAME VARCHAR2(50),
  LOCATION VARCHAR2(50)
);

CREATE OR REPLACE TYPE HR.dept_array
AS TABLE OF DEPARTMENT_TYPE;


CREATE OR REPLACE PACKAGE HR.objecttype AS

 PROCEDURE insert_object (d dept_array);

END objecttype;
/
CREATE OR REPLACE PACKAGE BODY HR.objecttype
AS
   PROCEDURE insert_object (d dept_array)
   AS
   BEGIN
      FOR i IN d.FIRST .. d.LAST
      LOOP
         INSERT INTO department_teststruct
              VALUES (d (i).dno, d (i).name, d (i).location);
      END LOOP;
   END insert_object;
END objecttype;
/
by ying515_huang
Mon 22 Aug 2011 02:51
Forum: dotConnect for Oracle
Topic: Table of records as in or out param in func or proc?
Replies: 3
Views: 1243

Table of records as in or out param in func or proc?

Hello,
Ca you tell me how I can call that kind of procedure/function with table of records as input or output parameters and make use of it in C# ?

OraclePackage.DescribeProcedure returns 5 parameters
IN1, IN2, OUT1, OUT2$SOME_ID, OUT2$SOME_STRING

But using these parameters for a call... fails.

Watching the Non-Public members of the OUT2 parameters, I came to see that it knows about T_RECORD type... So I'm a bit disappointed.

Code: Select all

CREATE OR REPLACE PACKAGE PCK_TESTDEVART AS

TYPE t_reccord IS RECORD (some_id integer, some_string varchar2(10));
TYPE t_records IS TABLE OF t_reccord Index By Binary_Integer;

PROCEDURE sp05(
   in1 in integer,
   in2 in t_records,
   out1 out integer,
   out2 out t_records
);

FUNCTION func05(
   in1 in integer,
   in2 in t_records,
   out1 out integer,
   out2 out t_records
) return integer;

END PCK_TESTDEVART; 
by ying515_huang
Mon 22 Aug 2011 02:48
Forum: dotConnect for Oracle
Topic: Table of records as in or out param in func or proc?
Replies: 6
Views: 1146

the same issue

we have the same issue! please get me modified sample!
my email:[email protected]
by ying515_huang
Wed 13 Apr 2011 10:11
Forum: dotConnect for Oracle
Topic: dotConnect for Oracle Can lock table or record?
Replies: 3
Views: 1662

But we use Devart LinqConnect Model!

Shalex wrote:Please use the FOR UPDATE statement like:

Code: Select all

try
{
//Lock DataSet
cmd = new OracleCommand("SELECT * FROM myTable WHERE id = :id FOR UPDATE NOWAIT", con);
cmd.Parameters.AddWithValue("id", id);

da.SelectCommand = cmd;
da.Fill(myDt);
//Do sth. with myDt
}

catch(OracleException ex)
{
if(ex.Code == 54)
errorMessage = "Data is in use. Please try again later.";
else
errorMessage = ex.Message;
}
But we use Devart LinqConnect Model!
We use Entity Developer Model Wizard?
How to do?
by ying515_huang
Wed 13 Apr 2011 08:21
Forum: dotConnect for Oracle
Topic: dotConnect for Oracle Can lock table or record?
Replies: 3
Views: 1662

dotConnect for Oracle Can lock table or record?

dotConnect for Oracle Can lock table or record?
How to do?
by ying515_huang
Wed 13 Apr 2011 08:19
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

Have anybody help me?

StanislavK wrote:Please specify the version of dotConnect for PostgreSQL with which you were working. If possible, please also send us a small complete sample where the scenario you've described is performed.
Have anybody help me?
by ying515_huang
Thu 24 Feb 2011 02:11
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

StanislavK wrote:LinqConnect attaches new entities on InsertOnSubmit, whereas LINQ to SQL does this on SubmitChanges only. Thank you for your assistance, we will consider the possibility of changing this behaviour. We will post here when our investigation is completed.
We already buy dotConnect for Oracle.
What time can fix this problem?
It is urgent, thanks!
by ying515_huang
Wed 23 Feb 2011 00:33
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

StanislavK wrote:I meant, could you please describe the situation in which you need two different objects representing the same entity?

Attaching entities at the InsertOnSubmit call is the designed behaviour. If you encounter problems with it in one of your application scenarios, please describe this scenario so that we can suggest a solution.

when user add a row that it is not SubmitChange(), so he find incorrect and want delete it!

why dotconnect LINQ can not db.TEST_DL_T.Attach(dl2) ?
the MS SQL LINQ can db.TEST_DL_T.Attach(dl2) ?
by ying515_huang
Wed 23 Feb 2011 00:33
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

StanislavK wrote:I meant, could you please describe the situation in which you need two different objects representing the same entity?

Attaching entities at the InsertOnSubmit call is the designed behaviour. If you encounter problems with it in one of your application scenarios, please describe this scenario so that we can suggest a solution.

when user add a row that it is not SubmitChange(), so he find incorrect and went delete it!
by ying515_huang
Tue 22 Feb 2011 05:41
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

ying515_huang wrote:
StanislavK wrote:This is a peculiarity of LinqConnect identity tracking: entities are attached to the data context immediately after the InsertOnSubmit method (apparently, LINQ to SQL attaches them only when the SubmitChanges method is executed). Could you please describe in more details the scenario in which such behaviour causes problems?
you can see my source code attachment file https://docs.google.com/leaf?id=0B1l5ui ... hl=zh_TW


the LINQ to SQL Source Code https://docs.google.com/leaf?id=0B1l5ui ... h&hl=zh_TW


MS SQL Schema:
CREATE TABLE [dbo].[TEST_DL_T](
[DL_ID] [int] NOT NULL,
[HD_ID] [int] NOT NULL,
[SEQ] [int] NOT NULL,
[ITEM_ID] [int] NOT NULL,
[QTY] [int] NOT NULL,
CONSTRAINT [PK_TEST_DL_T] PRIMARY KEY CLUSTERED
(
[DL_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
by ying515_huang
Tue 22 Feb 2011 01:00
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

StanislavK wrote:This is a peculiarity of LinqConnect identity tracking: entities are attached to the data context immediately after the InsertOnSubmit method (apparently, LINQ to SQL attaches them only when the SubmitChanges method is executed). Could you please describe in more details the scenario in which such behaviour causes problems?
you can see my source code attachment file https://docs.google.com/leaf?id=0B1l5ui ... hl=zh_TW

Oracle Schema:
CREATE TABLE ERPPORTAL.TEST_DL_T
(
DL_ID NUMBER,
HD_ID NUMBER,
SEQ NUMBER,
ITEM_ID NUMBER,
QTY NUMBER
)
TABLESPACE SMP
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 1M
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
NOMONITORING;
by ying515_huang
Mon 21 Feb 2011 04:01
Forum: dotConnect for Oracle
Topic: Cannot attach an entity with the key that already exists.
Replies: 17
Views: 10801

Cannot attach an entity with the key that already exists.

I want to SubmitChanges(), in simple table, in LINQ to SQL is no problem.
but in dotconnect for Oracle, it have error message "Cannot attach an entity with the key that already exists." Why?

Code: Select all

        public ActionResult Index()
        {
            using (myDataContext db = new myDataContext())
            {
                TestDlT dl = new TestDlT();
                dl.DlId = 1;
                dl.HdId = 1;
                dl.Seq = 1;
                dl.ItemId = 1;
                dl.Qty = 1;
                db.TestDlTs.InsertOnSubmit(dl);

                TestDlT dl2 = new TestDlT();
                dl2.DlId = 1;
                dl2.HdId = 1;
                dl2.Seq = 1;
                dl2.ItemId = 1;
                dl2.Qty = 1;
                db.TestDlTs.Attach(dl2);    // <--   Error
                db.TestDlTs.DeleteOnSubmit(dl2);

                db.SubmitChanges();
            }
SourceCode https://docs.google.com/leaf?id=0B1l5ui ... 0&hl=zh_TW

ASP.NET MVC 2.0 & Visual 2010 & framework 4.0
Oracle DB 9i
dotConnect Ver 5.70.190.0