Hello,
I have a button with wich the customer can refresh a complete table (CT_RELATIES) with the values from the database.
I call:
DB.Refresh(RefreshMode.OverwriteCurrentValues, DB.CT_RELATIES);
This takes quit some time, although the table only contains 39 records.
When I fill the table for the first time I use the statement:
SELECT t1.ID, ......
FROM UPLUS.CT_RELATIES t1
When I ask for the refresh I can see in the output-window, that the records are fetched one at the time (so I see 39 times the statement:
SELECT t1.ID, .....
FROM UPLUS.CT_RELATIES t1
WHERE ID = :np0
ParameterName = np0
DbType = Decimal
Value = 1126
)
That probably explains why it is so slow.
How can I refresh the whole table in one time?
Thanks
DataContex.Refresh gets the record one by one instead of ref
Now this is strange!
I have 2 methods to fill my tabel (ct_relaties):
public IEnumerable GetAll()
{
return DB.CT_RELATIES;
}
AND
public IEnumerable Test()
{
var q = from c in DB.CT_RELATIES
select c;
return q;
}
When I call either of the methods, the result is the same: 1 select-statement to the database:
SELECT t1.ID, t1.CODE, ...
FROM UPLUS.CT_RELATIES t1
But When I call a refresh like:
public override void RefreshFromDb()
{
DB.Refresh(RefreshMode.OverwriteCurrentValues, this.GetAll());
}
The result is: multiple calls to the datebase (For each record one call) like:
SELECT t1.ID, t1.CODE, ...
FROM UPLUS.CT_RELATIES t1
WHERE ID = :np0
ParameterName = np0
DbType = Decimal
Value = 1126
When I call a refresh like:
public override void RefreshFromDb()
{
DB.Refresh(RefreshMode.OverwriteCurrentValues, Test());
}
the result is (as expected) 1 call to the database.
Now I wonder: what is the difference?
Can anybody explain this?
Thanks in advance
I have 2 methods to fill my tabel (ct_relaties):
public IEnumerable GetAll()
{
return DB.CT_RELATIES;
}
AND
public IEnumerable Test()
{
var q = from c in DB.CT_RELATIES
select c;
return q;
}
When I call either of the methods, the result is the same: 1 select-statement to the database:
SELECT t1.ID, t1.CODE, ...
FROM UPLUS.CT_RELATIES t1
But When I call a refresh like:
public override void RefreshFromDb()
{
DB.Refresh(RefreshMode.OverwriteCurrentValues, this.GetAll());
}
The result is: multiple calls to the datebase (For each record one call) like:
SELECT t1.ID, t1.CODE, ...
FROM UPLUS.CT_RELATIES t1
WHERE ID = :np0
ParameterName = np0
DbType = Decimal
Value = 1126
When I call a refresh like:
public override void RefreshFromDb()
{
DB.Refresh(RefreshMode.OverwriteCurrentValues, Test());
}
the result is (as expected) 1 call to the database.
Now I wonder: what is the difference?
Can anybody explain this?
Thanks in advance
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
I will send you a sample in a letter, please check that it was not blocked by your mail filter. Please specify what should be changed in the sample to reproduce the problem or send us your test project.
We couldn't reproduce the problem with simple tables, the Refresh method always generates queries like
in our environment.
The table used in the sample can be created as
P.S.: I've deleted the duplicate topic in the dotConnect for Oracle forum.
We couldn't reproduce the problem with simple tables, the Refresh method always generates queries like
Code: Select all
SELECT t1.DEPTNO, t1.DNAME, t1.LOC
FROM DEPT t1
The table used in the sample can be created as
Code: Select all
CREATE TABLE DEPT (
DEPTNO NUMBER(4),
DNAME VARCHAR2(14),
LOC VARCHAR2(13),
CONSTRAINT PK_DEPT PRIMARY KEY (DEPTNO)
)
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Thank you for the sample. In our environment, all cases generated a single select statement. Could you please specify the following:
- the version of dotConnect for Oracle you are using;
- the version of Oracle server to which you are connecting;
- whether you use the Direct or OCI connection mode;
- in the case of the OCI mode, the version of Oracle client.
- the version of dotConnect for Oracle you are using;
- the version of Oracle server to which you are connecting;
- whether you use the Direct or OCI connection mode;
- in the case of the OCI mode, the version of Oracle client.