Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Friday, March 30, 2012

READ_UNCOMMITTED problem with SQL 2000 and i-net Opta 2000 JDBC

Hi,
I have a problem to set a JDBC connection as READ UNCOMMITED.

setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)

This is causing lots of blocking on tables
and update or insert doesn't work properly.

Does anyone have any idea what I'm missing here?

I asked i-net support and they suggested to call
setAutoCommit(false) after the above function
and it didn't work.
also suggested impltrans = true, and I changed that option on SQL
and it caused more blocking.

Thanks in advance for any info.neo wrote:

> Hi,
> I have a problem to set a JDBC connection as READ UNCOMMITED.
> setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> This is causing lots of blocking on tables
> and update or insert doesn't work properly.
> Does anyone have any idea what I'm missing here?
> I asked i-net support and they suggested to call
> setAutoCommit(false) after the above function
> and it didn't work.
> also suggested impltrans = true, and I changed that option on SQL
> and it caused more blocking.
> Thanks in advance for any info.

Why are you letting anyone, or any thing, read an uncommited
transaction? If it is not committed ... it doesn't exist.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||Daniel Morgan <damorgan@.x.washington.edu> wrote in message news:<1069122434.507152@.yasure>...
> neo wrote:
> > Hi,
> > I have a problem to set a JDBC connection as READ UNCOMMITED.
> > setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> > This is causing lots of blocking on tables
> > and update or insert doesn't work properly.
> > Does anyone have any idea what I'm missing here?
> > I asked i-net support and they suggested to call
> > setAutoCommit(false) after the above function
> > and it didn't work.
> > also suggested impltrans = true, and I changed that option on SQL
> > and it caused more blocking.
> > Thanks in advance for any info.
> Why are you letting anyone, or any thing, read an uncommited
> transaction? If it is not committed ... it doesn't exist.

This function sets dirty-read enable.
So even though there is blocking,
with this connection, data can still be read. That's what I want.|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote in message news:1069122434.507152@.yasure...
> neo wrote:
> > Hi,
> > I have a problem to set a JDBC connection as READ UNCOMMITED.
> > setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> > This is causing lots of blocking on tables
> > and update or insert doesn't work properly.
> > Does anyone have any idea what I'm missing here?
> > I asked i-net support and they suggested to call
> > setAutoCommit(false) after the above function
> > and it didn't work.
> > also suggested impltrans = true, and I changed that option on SQL
> > and it caused more blocking.
> > Thanks in advance for any info.
> Why are you letting anyone, or any thing, read an uncommited
> transaction? If it is not committed ... it doesn't exist.

ah.. this is a typical oracleisque response. Well there are
some circumstances when READ_UNCOMMITTED makes perfect sense.
For e.g. if u r running report on past data (like last week's report)
which is guaranteed to be read-only at the time of running
the report. why bother about COMMITTED data? a simple dirty
read will do the job as effectively, but more efficiently.

Oracle's MVRC sounds great, but unless it gives an option
to bypass when it is unnecessary, it is an overkill.

rk-|||rkusenet wrote:

> "Daniel Morgan" <damorgan@.x.washington.edu> wrote in message news:1069122434.507152@.yasure...
>>neo wrote:
>>
>>
>>>Hi,
>>>I have a problem to set a JDBC connection as READ UNCOMMITED.
>>>
>>>setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
>>>
>>>This is causing lots of blocking on tables
>>>and update or insert doesn't work properly.
>>>
>>>Does anyone have any idea what I'm missing here?
>>>
>>>I asked i-net support and they suggested to call
>>>setAutoCommit(false) after the above function
>>>and it didn't work.
>>>also suggested impltrans = true, and I changed that option on SQL
>>>and it caused more blocking.
>>>
>>>Thanks in advance for any info.
>>
>>Why are you letting anyone, or any thing, read an uncommited
>>transaction? If it is not committed ... it doesn't exist.
>
> ah.. this is a typical oracleisque response. Well there are
> some circumstances when READ_UNCOMMITTED makes perfect sense.
> For e.g. if u r running report on past data (like last week's report)
> which is guaranteed to be read-only at the time of running
> the report. why bother about COMMITTED data? a simple dirty
> read will do the job as effectively, but more efficiently.
> Oracle's MVRC sounds great, but unless it gives an option
> to bypass when it is unnecessary, it is an overkill.
> rk-

Makes sense but if you only do READ_UNCOMMITTED on old data why not just
partition it?

My concern is that while some might use this as you describe ... others
could just as easily produce invalid reports. There is no protection in
the system to protect the end-user. How do they know?
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote

> Makes sense but if you only do READ_UNCOMMITTED on old data why not just
> partition it?

why an oracle like approach for everything :-) U asked a question whether
READ_UNCOMMITTED has any value, I gave one and I can give many more
examples like this where a particular ISOLATION mode may be appropriate.

Oracle's assumption that its MVRC is best for all situations is plain
horse manure. They should give the flexibility to the developers to
use appropriate ISOLATION mode. I use it in Informix and SQLSERVER and
I am very happy with these products (atleast on this count) which gives
me the flexibility.

> My concern is that while some might use this as you describe ... others
> could just as easily produce invalid reports. There is no protection in
> the system to protect the end-user. How do they know?

well, I am using ur own words of wisdon. Learn to work in SQLSERVER as
it is suppose to work, not like Oracle :-). I expect SQLSERVER developrs
to have an understanding of ISOLATION level.

rk-|||"rkusenet" <rkusenet@.sympatico.ca> wrote in message
news:bpdm0b$1nhu6v$1@.ID-75254.news.uni-berlin.de...
> "Daniel Morgan" <damorgan@.x.washington.edu> wrote in message
news:1069122434.507152@.yasure...
> > neo wrote:
> > > Hi,
> > > I have a problem to set a JDBC connection as READ UNCOMMITED.
> > > > setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> > > > This is causing lots of blocking on tables
> > > and update or insert doesn't work properly.
> > > > Does anyone have any idea what I'm missing here?
> > > > I asked i-net support and they suggested to call
> > > setAutoCommit(false) after the above function
> > > and it didn't work.
> > > also suggested impltrans = true, and I changed that option on SQL
> > > and it caused more blocking.
> > > > Thanks in advance for any info.
> > Why are you letting anyone, or any thing, read an uncommited
> > transaction? If it is not committed ... it doesn't exist.
> ah.. this is a typical oracleisque response. Well there are
> some circumstances when READ_UNCOMMITTED makes perfect sense.
> For e.g. if u r running report on past data (like last week's report)
> which is guaranteed to be read-only at the time of running
> the report. why bother about COMMITTED data? a simple dirty
> read will do the job as effectively, but more efficiently.

Unless you're running low on memory and getting lock escalation from row to
page lock, I don't see why your past data (assuming you don't update past
data) will have a lock on them. If there's no lock, then why would there be
a difference between doing READ_UNCOMMITTED and READ_COMMITTED on those
rows. If there's no difference, then why did you say READ_UNCOMMITTED will
do the job "more efficiently"?

Cheers,
Dave

> Oracle's MVRC sounds great, but unless it gives an option
> to bypass when it is unnecessary, it is an overkill.
> rk-|||One concern I have with uncommitted/dirty read is that documentation says
that "this is the lowest level where transactions are isolated only enough
to ensure that physically corrupt data is not read". This is not enough to
guarantee row-level read consistency, meaning you might not get data of the
same version for all columns, particularly for columns which have BLOB or
CLOB types for which the data is typically stored in another page.

- Dave

"Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote
in message news:SMvub.33830$sk4.10816@.newssvr27.news.prodigy. com...
> "rkusenet" <rkusenet@.sympatico.ca> wrote in message
> news:bpdm0b$1nhu6v$1@.ID-75254.news.uni-berlin.de...
> > "Daniel Morgan" <damorgan@.x.washington.edu> wrote in message
> news:1069122434.507152@.yasure...
> > > neo wrote:
> > > > > Hi,
> > > > I have a problem to set a JDBC connection as READ UNCOMMITED.
> > > > > > setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> > > > > > This is causing lots of blocking on tables
> > > > and update or insert doesn't work properly.
> > > > > > Does anyone have any idea what I'm missing here?
> > > > > > I asked i-net support and they suggested to call
> > > > setAutoCommit(false) after the above function
> > > > and it didn't work.
> > > > also suggested impltrans = true, and I changed that option on SQL
> > > > and it caused more blocking.
> > > > > > Thanks in advance for any info.
> > > > Why are you letting anyone, or any thing, read an uncommited
> > > transaction? If it is not committed ... it doesn't exist.
> > ah.. this is a typical oracleisque response. Well there are
> > some circumstances when READ_UNCOMMITTED makes perfect sense.
> > For e.g. if u r running report on past data (like last week's report)
> > which is guaranteed to be read-only at the time of running
> > the report. why bother about COMMITTED data? a simple dirty
> > read will do the job as effectively, but more efficiently.
> Unless you're running low on memory and getting lock escalation from row
to
> page lock, I don't see why your past data (assuming you don't update past
> data) will have a lock on them. If there's no lock, then why would there
be
> a difference between doing READ_UNCOMMITTED and READ_COMMITTED on those
> rows. If there's no difference, then why did you say READ_UNCOMMITTED
will
> do the job "more efficiently"?
> Cheers,
> Dave
> > Oracle's MVRC sounds great, but unless it gives an option
> > to bypass when it is unnecessary, it is an overkill.
> > rk-|||"neo" <second714@.hotmail.com> wrote in message
news:155f8e7d.0311171747.939d534@.posting.google.co m...
> Hi,
> I have a problem to set a JDBC connection as READ UNCOMMITED.
> setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> This is causing lots of blocking on tables
> and update or insert doesn't work properly.

When compared with READ COMMITTED, did you get more or same or less blocking
using READ UNCOMMITTED? Maybe your updates and inserts by themselves
already generate a lot of blocking, irrespective of your reads. This can
happen say for example if you run low on memory and SQL Server starts
locking pages instead of rows.

Another suggestion I can think of is update your JDBC driver to the latest
version.

HTH,
Dave

> Does anyone have any idea what I'm missing here?
> I asked i-net support and they suggested to call
> setAutoCommit(false) after the above function
> and it didn't work.
> also suggested impltrans = true, and I changed that option on SQL
> and it caused more blocking.
> Thanks in advance for any info.|||"Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote
in message news:SMvub.33830$sk4.10816@.newssvr27.news.prodigy. com...
> "rkusenet" <rkusenet@.sympatico.ca> wrote in message
> news:bpdm0b$1nhu6v$1@.ID-75254.news.uni-berlin.de...
> > "Daniel Morgan" <damorgan@.x.washington.edu> wrote in message
> news:1069122434.507152@.yasure...
> > > neo wrote:
> > > > > Hi,
> > > > I have a problem to set a JDBC connection as READ UNCOMMITED.
> > > > > > setTransactionIsolation(Connection.TRANSACTION_REA D_UNCOMMITTED)
> > > > > > This is causing lots of blocking on tables
> > > > and update or insert doesn't work properly.
> > > > > > Does anyone have any idea what I'm missing here?
> > > > > > I asked i-net support and they suggested to call
> > > > setAutoCommit(false) after the above function
> > > > and it didn't work.
> > > > also suggested impltrans = true, and I changed that option on SQL
> > > > and it caused more blocking.
> > > > > > Thanks in advance for any info.
> > > > Why are you letting anyone, or any thing, read an uncommited
> > > transaction? If it is not committed ... it doesn't exist.
> > ah.. this is a typical oracleisque response. Well there are
> > some circumstances when READ_UNCOMMITTED makes perfect sense.
> > For e.g. if u r running report on past data (like last week's report)
> > which is guaranteed to be read-only at the time of running
> > the report. why bother about COMMITTED data? a simple dirty
> > read will do the job as effectively, but more efficiently.
> Unless you're running low on memory and getting lock escalation from row
to
> page lock, I don't see why your past data (assuming you don't update past
> data) will have a lock on them. If there's no lock, then why would there
be
> a difference between doing READ_UNCOMMITTED and READ_COMMITTED on those
> rows. If there's no difference, then why did you say READ_UNCOMMITTED
will
> do the job "more efficiently"?

Never mind. I see - because of the overhead of the single read lock when
you use READ_COMMITTED. My bad.

- Dave

> Cheers,
> Dave
> > Oracle's MVRC sounds great, but unless it gives an option
> > to bypass when it is unnecessary, it is an overkill.
> > rk-|||"Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote

> > ah.. this is a typical oracleisque response. Well there are
> > some circumstances when READ_UNCOMMITTED makes perfect sense.
> > For e.g. if u r running report on past data (like last week's report)
> > which is guaranteed to be read-only at the time of running
> > the report. why bother about COMMITTED data? a simple dirty
> > read will do the job as effectively, but more efficiently.
> Unless you're running low on memory and getting lock escalation from row to
> page lock, I don't see why your past data (assuming you don't update past
> data) will have a lock on them. If there's no lock, then why would there be
> a difference between doing READ_UNCOMMITTED and READ_COMMITTED on those
> rows. If there's no difference, then why did you say READ_UNCOMMITTED will
> do the job "more efficiently"?

actually I should have been clearer.
the more efficiently part was in comparison to oracle's MVRC approach,
not a one to one comparison between SQLSERVER RC and RUC approach.

Even within SQLSERVER RC and RUC, RUC is slightly more efficient since
it does not have to put a read lock on a row.

RUC vs MVRC is all together different. In MVRC it has to check for
every page whether the SCN is less than the SCN when the query started,
a totally unnecessary step for the case in question.|||rkusenet wrote:

<snipped>
> RUC vs MVRC is all together different. In MVRC it has to check for
> every page whether the SCN is less than the SCN when the query started,
> a totally unnecessary step for the case in question.

True. But on the other hand it doesn't have to check to see if the
row is locked. Because in the Oracle world it would be irrelevant.
Writes don't block reads and reads don't brock writes.

All RDBMS's have over-head issues. They are always there ... they are
just different.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote in message news:1069192733.974181@.yasure...
> rkusenet wrote:
> <snipped>
> > RUC vs MVRC is all together different. In MVRC it has to check for
> > every page whether the SCN is less than the SCN when the query started,
> > a totally unnecessary step for the case in question.
> True. But on the other hand it doesn't have to check to see if the
> row is locked.

That is in RC and SER only.
RUC does not check whether the row is locked and for the case in
question, RUC is best.

> Because in the Oracle world it would be irrelevant.
> Writes don't block reads and reads don't brock writes.

oracle does not give any flexiblity in writing the application as
required. It forces MVRC always. In Informix I use RC, RUC and
SER as they are required on a case to case basis. Now I follow
the same priciple in SQLServer also.

I am not denying that MVRC is good. All I am disputing is that
it is DA best for every situation, as Oracle arrogantly assumes.
Clearly it isn't.

I believe SQLServer is implementing MVRC in Yukon. That's great,
since they will still be offering RC,RUC and SER. Oracle should also
do that.

rk-|||rkusenet wrote:

> "Daniel Morgan" <damorgan@.x.washington.edu> wrote in message news:1069192733.974181@.yasure...
>>rkusenet wrote:
>>
>><snipped>
>>
>>>RUC vs MVRC is all together different. In MVRC it has to check for
>>>every page whether the SCN is less than the SCN when the query started,
>>>a totally unnecessary step for the case in question.
>>>
>>
>>True. But on the other hand it doesn't have to check to see if the
>>row is locked.
>
> That is in RC and SER only.
> RUC does not check whether the row is locked and for the case in
> question, RUC is best.
>
>>Because in the Oracle world it would be irrelevant.
>>Writes don't block reads and reads don't brock writes.
>
> oracle does not give any flexiblity in writing the application as
> required. It forces MVRC always. In Informix I use RC, RUC and
> SER as they are required on a case to case basis. Now I follow
> the same priciple in SQLServer also.
> I am not denying that MVRC is good. All I am disputing is that
> it is DA best for every situation, as Oracle arrogantly assumes.
> Clearly it isn't.
> I believe SQLServer is implementing MVRC in Yukon. That's great,
> since they will still be offering RC,RUC and SER. Oracle should also
> do that.
> rk-

Arrogantly is no more a constructive phrase when referring to MVCC than
would be the same statement with respect to SQL Server's inability to
run on a UNIX platform. Lets leave the hyperbole to the marketing
departments where it belongs.

Then visit this link:
http://download-west.oracle.com/doc...06a.htm#2067250

and notice the graphic a few inches from the bottom of the first page.
The one that contains SET TRANSACTION. See anything that might make you
reconsider the depth of your knowledge of Oracle?
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote
> Then visit this link:
> http://download-west.oracle.com/doc...06a.htm#2067250
> and notice the graphic a few inches from the bottom of the first page.
> The one that contains SET TRANSACTION. See anything that might make you
> reconsider the depth of your knowledge of Oracle?

I never claimed that I am an expert in Oracle. Indeed I would have worked
less than six months of my career in Oracle. My information about MVRC
is based on what oracle marketing literature.

However it gives me a good idea on the depth of ur knowledge
as a database teacher in Washingto Univ if u make a stupid
and false claim that reading uncommitted data is useless under
all circumstances. I proved it isn't.

Now that we both have insulted each other, can u come to the
point. Does oracle allow applications to bypass MVRC. I could
have gone to the above link, but it requires a registered login.

thanks.

rk-|||"rkusenet" <rkusenet@.sympatico.ca> wrote in message
news:bpeddq$1m702g$1@.ID-75254.news.uni-berlin.de...
> "Daniel Morgan" <damorgan@.x.washington.edu> wrote
> > Then visit this link:
http://download-west.oracle.com/doc...06a.htm#2067250
> > and notice the graphic a few inches from the bottom of the first page.
> > The one that contains SET TRANSACTION. See anything that might make you
> > reconsider the depth of your knowledge of Oracle?
> I never claimed that I am an expert in Oracle. Indeed I would have worked
> less than six months of my career in Oracle. My information about MVRC
> is based on what oracle marketing literature.
> However it gives me a good idea on the depth of ur knowledge
> as a database teacher in Washingto Univ if u make a stupid
> and false claim that reading uncommitted data is useless under
> all circumstances. I proved it isn't.
> Now that we both have insulted each other, can u come to the
> point. Does oracle allow applications to bypass MVRC. I could
> have gone to the above link, but it requires a registered login.

I think what rk is talking about is whether Oracle ever allows you to read a
block without checking its SCN.

SET TRANSACTION READ ONLY and SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
use transaction-level read consistency, whereas SET TRANSACTION READ WRITE
and SET TRANSACTION ISOLATION LEVEL READ COMMITTED use statement-level read
consistency. The bottom line is these all require checking the SCN of every
block that you read, comparing its SCN to the SCN of either the beginning of
statement execution, or the beginning of the transaction, and rolling back
the data if necessary. AFAIK, there's no mechanism in Oracle to read a
block without checking its SCN, although SCN checking is basically only an
integer comparison, and even though you're doing it for every block read, I
don't think it represents any significant overhead compared to the time it
takes to actually read the block.

- Dave

> thanks.
>
> rk-|||"Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote

> I think what rk is talking about is whether Oracle ever allows you to read a
> block without checking its SCN.

correct. just like Read Uncommitted allows reading a row without checking
for anything.

> SET TRANSACTION READ ONLY and SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
> use transaction-level read consistency, whereas SET TRANSACTION READ WRITE
> and SET TRANSACTION ISOLATION LEVEL READ COMMITTED use statement-level read
> consistency. The bottom line is these all require checking the SCN of every
> block that you read, comparing its SCN to the SCN of either the beginning of
> statement execution, or the beginning of the transaction, and rolling back
> the data if necessary. AFAIK, there's no mechanism in Oracle to read a
> block without checking its SCN, although SCN checking is basically only an
> integer comparison, and even though you're doing it for every block read

So I was right.

> I don't think it represents any significant overhead compared to the time it
> takes to actually read the block.

In real world applications, YMMV.

rk-|||Comments in-line

rkusenet wrote:
> "Daniel Morgan" <damorgan@.x.washington.edu> wrote
>>Then visit this link:
>>http://download-west.oracle.com/doc...06a.htm#2067250
>>
>>and notice the graphic a few inches from the bottom of the first page.
>>The one that contains SET TRANSACTION. See anything that might make you
>>reconsider the depth of your knowledge of Oracle?
>
> I never claimed that I am an expert in Oracle. Indeed I would have worked
> less than six months of my career in Oracle. My information about MVRC
> is based on what oracle marketing literature.

Good lord man. I hope you don't buy or use any product, not even a
dish washer basedon marketing literature.

> However it gives me a good idea on the depth of ur knowledge
> as a database teacher in Washingto Univ if u make a stupid
> and false claim that reading uncommitted data is useless under
> all circumstances. I proved it isn't.

Don't mean to be insulting here but perhaps you should re-read my posts,
I never said reading uncommitted data was useless. Dangerous perhaps but
not useless: Never used the word.

> Now that we both have insulted each other, can u come to the
> point. Does oracle allow applications to bypass MVRC. I could
> have gone to the above link, but it requires a registered login.

If by bypass you mean transactions that don't use it? Yes! But if you
think that means dirty reads ... no.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||Comments inline.

rkusenet wrote:

> "Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote
>
>>I think what rk is talking about is whether Oracle ever allows you to read a
>>block without checking its SCN.
> correct. just like Read Uncommitted allows reading a row without checking
> for anything.

This is an impossible question to answer. Because you can not ever read
a block (in SQL Server verbiage page) without reading the SCN as it is
stored in the block. You can't read something and not read part of it.
Even if you wanted to the operating system would ignore you. Sort of
like asking MS Word to open a document but not read the document's font
information.

But if you mean not use multiversion concurrency with the SCN to
determine whether the row has been changed yes you can.

>>SET TRANSACTION READ ONLY and SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
>>use transaction-level read consistency, whereas SET TRANSACTION READ WRITE
>>and SET TRANSACTION ISOLATION LEVEL READ COMMITTED use statement-level read
>>consistency. The bottom line is these all require checking the SCN of every
>>block that you read, comparing its SCN to the SCN of either the beginning of
>>statement execution, or the beginning of the transaction, and rolling back
>>the data if necessary. AFAIK, there's no mechanism in Oracle to read a
>>block without checking its SCN, although SCN checking is basically only an
>>integer comparison, and even though you're doing it for every block read
>
> So I was right.

No you weren't. I'd suggest you stop spending so much energy trying to
be correct and use this as an opportunity to learn something. You may
well end up on a project some day that requires knowledge of more than a
single RDBMS. I, for example, am currently working in Oracle, Informix,
SQL Server, MS Access, and FoxPro between a variety of projects.

>>I don't think it represents any significant overhead compared to the time it
>>takes to actually read the block.

It takes zero extra time because it is part of the block. If a block is
8K then part of that 8K is the SCN information.

> In real world applications, YMMV.
> rk-

--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote in message
news:1069217819.771457@.yasure...
> Comments inline.
> rkusenet wrote:
> > "Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam>
wrote
> >>I think what rk is talking about is whether Oracle ever allows you to
read a
> >>block without checking its SCN.
> > correct. just like Read Uncommitted allows reading a row without
checking
> > for anything.
> This is an impossible question to answer. Because you can not ever read
> a block (in SQL Server verbiage page) without reading the SCN as it is
> stored in the block. You can't read something and not read part of it.
> Even if you wanted to the operating system would ignore you. Sort of
> like asking MS Word to open a document but not read the document's font
> information.
> But if you mean not use multiversion concurrency with the SCN to
> determine whether the row has been changed yes you can.
> >>SET TRANSACTION READ ONLY and SET TRANSACTION ISOLATION LEVEL
SERIALIZABLE
> >>use transaction-level read consistency, whereas SET TRANSACTION READ
WRITE
> >>and SET TRANSACTION ISOLATION LEVEL READ COMMITTED use statement-level
read
> >>consistency. The bottom line is these all require checking the SCN of
every
> >>block that you read, comparing its SCN to the SCN of either the
beginning of
> >>statement execution, or the beginning of the transaction, and rolling
back
> >>the data if necessary. AFAIK, there's no mechanism in Oracle to read a
> >>block without checking its SCN, although SCN checking is basically only
an
> >>integer comparison, and even though you're doing it for every block read
> > So I was right.
> No you weren't. I'd suggest you stop spending so much energy trying to
> be correct and use this as an opportunity to learn something. You may
> well end up on a project some day that requires knowledge of more than a
> single RDBMS. I, for example, am currently working in Oracle, Informix,
> SQL Server, MS Access, and FoxPro between a variety of projects.
> >>I don't think it represents any significant overhead compared to the
time it
> >>takes to actually read the block.
> It takes zero extra time because it is part of the block. If a block is
> 8K then part of that 8K is the SCN information.

Daniel, I think what rk is talking about is whether Oracle ever allows you
to read a block without *checking* its SCN, not just reading the SCN. Of
course, you're right - when you read a block, you read the SCN as well. But
he's talking about the extra step of checking the SCN against the SCN at the
beginning of the statement execution (for statement level read consistency)
or the SCN at the beginning of the transaction (for transaction level read
consistency) to determine if you need to roll back the block.

Regards,
Dave

> > In real world applications, YMMV.
> > rk-
> --
> Daniel Morgan
> http://www.outreach.washington.edu/...oad/oad_crs.asp
> http://www.outreach.washington.edu/...aoa/aoa_crs.asp
> damorgan@.x.washington.edu
> (replace 'x' with a 'u' to reply)|||Dave Hau wrote:
> Daniel, I think what rk is talking about is whether Oracle ever allows you
> to read a block without *checking* its SCN, not just reading the SCN. Of
> course, you're right - when you read a block, you read the SCN as well. But
> he's talking about the extra step of checking the SCN against the SCN at the
> beginning of the statement execution (for statement level read consistency)
> or the SCN at the beginning of the transaction (for transaction level read
> consistency) to determine if you need to roll back the block.
> Regards,
> Dave

The SCN is only checked in transactions where the data could have been
modified between the initiation of the transaction and when the cursor
gets to the rows. One example of the SCN being ignored is in read-only
tablespaces. Another would be when rows are intentionally locked with
SELECT FOR UPDATE.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote
> The SCN is only checked in transactions where the data could have been
> modified between the initiation of the transaction and when the cursor
> gets to the rows. One example of the SCN being ignored is in read-only
> tablespaces.

Do datas get moved to read-only tablespaces magically. If I have a workflow
table where rows only get inserted/updated for a short period of time,
and then remain static, it makes sense to use READ UNCOMMITTED when running
reports for anything other than the current activities.
I don't know how easy it is in oracle to move yesterday's data in a read-only
tablespace.

>This is an impossible question to answer. Because you can not ever read
>a block (in SQL Server verbiage page) without reading the SCN as it is
>stored in the block.

What about comparing the SCN in data block with the SCN when the query
was initiated. As I see, unless it is a read only tablespace or SELECT
FOR UPDATE, it always does this SCN comparison. It is this SCN comparison
which I think is totally unnecessary when dealing with static data
as in the above example I gave.

rk-|||rkusenet wrote:
> "Daniel Morgan" <damorgan@.x.washington.edu> wrote
>>The SCN is only checked in transactions where the data could have been
>>modified between the initiation of the transaction and when the cursor
>>gets to the rows. One example of the SCN being ignored is in read-only
>>tablespaces.
>
> Do datas get moved to read-only tablespaces magically.

Can you ask a question without being belitteling, demeaning and/or
insulting? I'm serious: Because the answer to this questions is
blazingly obvious.

My contributions are an attempt to educate not some testosterone laden
internet contest. I invite you to reask your question with more
appropriate verbiage if you actually want an answer.

If not ... you win, I lose, you're the man.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)|||"Daniel Morgan" <damorgan@.x.washington.edu> wrote

> Can you ask a question without being belitteling, demeaning and/or
> insulting? I'm serious: Because the answer to this questions is
> blazingly obvious.
> My contributions are an attempt to educate not some testosterone laden
> internet contest. I invite you to reask your question with more
> appropriate verbiage if you actually want an answer.

I admit that the tone of my post was derisive and it was intentional.
Bcos I find you highly opinionated and the way u insult non oracle
products is offending. Be prepared to get offended if u offend others.

You find faults with all products and jump in to defend Oracle the moment
it is attacked, making ur bias too obvious. For e.g. you mentioned recently
that SQL Server is so bad that even a non tuned Oracle/Informix/DB2 can give
performance upto 9x times. Bah. I agree that SQLServer is not yet in the
class of Informix, but to say that it is way behind them is plain stupid.
Do u think some of the heavily used sites like BarnesAndNoble, Dell,Expedia
are stupid to use SQLServer. or Verizon Communications, Lucent etc.

check this: http://www.wintercorp.com/vldb/2003...pTenWinners.asp

You can disregard my question re: oracle read-only tablespace. At this time I
have no desire to learn about Oracle.

I sincerely offer my apology if I offended you and I hope that you will
also change your attitude towards non oracle products.

cheers.

rk-
|||rkusenet wrote:

> "Daniel Morgan" <damorgan@.x.washington.edu> wrote
>
>>Can you ask a question without being belitteling, demeaning and/or
>>insulting? I'm serious: Because the answer to this questions is
>>blazingly obvious.
>>My contributions are an attempt to educate not some testosterone laden
>>internet contest. I invite you to reask your question with more
>>appropriate verbiage if you actually want an answer.
>
> I admit that the tone of my post was derisive and it was intentional.
> Bcos I find you highly opinionated and the way u insult non oracle
> products is offending. Be prepared to get offended if u offend others.
> You find faults with all products and jump in to defend Oracle the moment
> it is attacked, making ur bias too obvious. For e.g. you mentioned recently
> that SQL Server is so bad that even a non tuned Oracle/Informix/DB2 can give
> performance upto 9x times. Bah. I agree that SQLServer is not yet in the
> class of Informix, but to say that it is way behind them is plain stupid.
> Do u think some of the heavily used sites like BarnesAndNoble, Dell,Expedia
> are stupid to use SQLServer. or Verizon Communications, Lucent etc.
> check this: http://www.wintercorp.com/vldb/2003...pTenWinners.asp
> You can disregard my question re: oracle read-only tablespace. At this time I
> have no desire to learn about Oracle.
> I sincerely offer my apology if I offended you and I hope that you will
> also change your attitude towards non oracle products.
> cheers.
> rk-

I'm not in marketing and make no more money from Oracle than I do
from other RDBMS products. That I teach one at the U says more about
what the students want than anything else. And I have repeatedly pointed
out that different RDBMS products are different. I don't rush to defend
or attack any of them because I have no vested interest in any one of them.

If you insist on putting a value judgement on differences ... good
vs evil, white hat vs black hat, cowboys vs indians, that is your value
judgement ... not mine. And I'm not at all offended. I just don't choose
to play games that consist primarily of seeing who can have the most
testosterone shooting from their eyeballs.

As an educator I am surprised you have no interest in learning Oracle. I
make it a point to keep up my skills in SQL Server, DB2, and Informix.
Used to also keep current in Sybase and Teradata. Much of my consulting
work comes from helping people that don't know multiple products perform
migrations or make a product work in heterogenous environments. Guess I
should thank you for keeping my vacation plans on-track.
--
Daniel Morgan
http://www.outreach.washington.edu/...oad/oad_crs.asp
http://www.outreach.washington.edu/...aoa/aoa_crs.asp
damorgan@.x.washington.edu
(replace 'x' with a 'u' to reply)sql

Monday, March 12, 2012

RDO Connection through VB

Hi,

I am using VB to connect to the database and I am using RDO (Remote Data Objects) for this connectivity.

For security reasons, I am using the userid and password retrieved from a different database to establish the connection to the production server. The password we retrieve is encrypted and the connection program decrypts that and connects.

All is fine so far. But after I connect to the database, in the VB project, in the debug mode, I can see the connection string by accessing the property RdoConnection.Connect.

Is there a way, by which, I could establish the rdoconnection and immediately after that, change the 'Connect' property of that to something else, so that it does not have the actual connection information?

Thanks in advance
RajI don't think so. When you change the connect property, I think you will lose the connection.

You could make the class that holds the RDO object private so that it is not remotely accessible. You should also make the RDO object private to the class, and provide write-only access to the connection string by creating a Let property with no Get property.

Friday, March 9, 2012

RDC Connection string data

I am using RDC for the Crystal Report 8. I use VB6 and connect to a MSSQL 2000 DB. I currently connect to the database by:

CRReport.Database.Tables(1).SetLogOnInfo sCRServer, sCRDatabase, sCRLogin, sCRPassword

and that works fine, but I would like to be able to pass the Workstation ID(WSID) and App name(APP) like can be done in a standard ado connection string.

i.e.
Cn = "uid=sa;pwd=admin;driver={SQL Server};server=NTSERVER5;WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"

Any ideas on how to pass that information for crystal to use it, when logging in?I also connected to crystal using :
CRReport.Database.LogOnServerEx "pdssql.dll", sCRServer, sCRDatabase, sCRLogin, sCRPassword, "uid=sa;pwd=admin;driver={pdssql.dll};server=" & sCRServer & ";WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & "CR" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"

but MS SQL in the Prodcess Info, when the report runs stilll doesn't show the WSID and APP information on the server. I passed it above, but??

Any ideas.

thanks,

Dean

Saturday, February 25, 2012

RDA Pull method not creating tables/inserting data

I can't see what is going on, this is the situation:

I call the Pull method, specify the table to be affected, the query to be used, the connection string to the remote SQL server, the tracking options (On) and the Error table. The pull method executes with no errors however, no table is ever created. I don't know why, here's what I have done so far:

I read the SQL BOOKS ONLINE help on preparing RDA, I set up the IIS virtual directory for anonymous access and on the connection string I send in the user name and password for the SQL server, I went into the SQL Server and grated access to the user name to the database that I am going to access and I made the user a db_owner.

So, according to SQL BOOKS ONLINE I have everything right however, it won't populate, so right now I am open to suggestions on how to get this to work, heres the code:
---------
string rdaOleDbConnectString = "Provider=SQLOLEDB;Data Source=<Server>;Initial Catalog=<DB>; User Id=<User>;Password=<Password>"; (it's not exactly like this, but in it has the proper values)
string connectionString = "Data Source=\"\\Program Files\\client\\db\\MobileDB.sdf\"";

SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess("http://10.1.1.206/mobile/sqlcesa30.dll",
connectionString);

IList _tableNames = new ArrayList();
IList _queries = new ArrayList();

############
Code that prepares tables and queries
############

for (int counter = 0; counter < _tableNames.Count; counter++)
{
rda.Pull(_tableNames[counter].ToString(), _queries[counter].ToString(), rdaOleDbConnectString, RdaTrackOption.TrackingOn, "MobileError");
}

the For loop runs with no problems but no data is ever put (or tables created) into the Mobile DB.

A few things here -

1. from pocket internet explorer on your device or emulator, do you get a correct diagnostic message when you use the url http://10.1.1.206/mobile/sqlcesa30.dll ? if not, then your first issue is you aren't successfully getting from device to the server.

2. your connection string is screwed up. try this instead: connectionString = @."Data Source = \Program Files\client\db\MobileDB.sdf"

3. you do realize that the database must exist already before the pull? and that none of those tables can exist when you call pull? (you need to drop all the tables you want to pull from the server before you call rda.Pull()

4. the values you are using for <user> and <password> must represent a valid SQL Server login as well as have permissions on the specific database you are pulling from <DB>

5. what are you using for primary keys on the tables you are pulling? IDENTITY columns are going to get you into trouble with multiple users pulling with tracking turned on. better to switch to uniqueidentifiers (GUIDs).

Try that much and let me know.

Darren

|||

To answer your questions:

1. I get "SQL Server Mobile Server Agent 3.0" when I try to browse to the URL

2. I will try it without the quotes.

3. Yes, I know the tables must not exists prior to PULL

4. I had made the SQL user a db_owner

5. GUIDS

|||

It did not work, I changed the connection string from:

"Data Source=\"\\Program Files\\client\\db\\MobileDB.sdf\"";

to

"Data Source=\\Program Files\\client\\db\\MobileDB.sdf";

and it still didn't work

|||

if I understand correctly, you are not getting an exception, you're just not getting the tables created in the SQL mobile database after the pull? Are you just using a SELECT * FROM statement to pull each table? Maybe try reducing this to pulling a single table in case there is some issue with your logic to iterate through a collection of tables pulling each one. Also - not knowing the schema of the server side db, are there any constraints on those tables?

-Darren

|||

I just remembered something that I bet is your issue - when you install SQL Server, you have to specify an authentication mode for the server. By default, it is Windows Authentication. In your RDA connection string, you are using SQL Server authentication. As a result, you need to make sure your instance of SQL Server is set to "Mixed Mode (Windows Authentication and SQL Server Authentication).

Hope that helps.

Darren

|||Thanx, I'll try that|||we decided to give merge replication a shot, we may comeback to trying RDA later.

RDA pull error on SSL VPN Client connection

I have a VB 2005 synchronization application that successfully pulls (through RDA) data to a SQL 2005 Mobile DB at my place of business, but when I try it at home on my SSL VPN Client connection, I get Hresult -2147012889 ("A request to send data to the computer running IIS has failed."). Typically, a -2147012889 error is a connection issue that relates to resolving the server name.

Here's a snippet:

Dim RemoteConn As String = "Provider=sqloledb; Data Source={company server};" _

& "Initial Catalog={companyDB}; User ID={username}; password={pass}"

'& "Persist Security Info=False;Integrated Security=False"

Dim SourceURL As String = "http://{Company server name}/MobileConnection/sqlcesa30.dll"

Dim SqlRA As New System.Data.SqlServerCe.SqlCeRemoteDataAccess

SqlRA.LocalConnectionString = strConn

SqlRA.InternetUrl = SourceURL

SqlRA.InternetLogin = ""

SqlRA.InternetPassword = ""

SqlRA.CompressionLevel = 3

Try

(Perform Pulls...etc..)

When I pull the sourceURL string and plug it into IE, it works fine. I get the "SQL Server Mobile Server Agent 3.0" message indicating that I have a solid connection over to IIS. That works fine.

But I can't figure out anything in the program. I've rotated the IP address with the name resolution and neither works for me in the program. The difference though when I use the IP address for the server is that I get a slightly different Hresult of -2147012867 (which means you can't connect to the server).

Also, I have IIS configured for anonymous access, the SQL DB I'm trying to pull from isn't restricting access, and my company doesn't have a proxy I need to go through.

Does anyone have any ideas for this issue?

Hi,

Did you find the answer? I have situation almost same as you and I am getting an error too. Do you know any tutorial for RDA using SSL?

Thanks in advance.

Dharam

RDA pull error on SSL VPN Client connection

I have a VB 2005 synchronization application that successfully pulls (through RDA) data to a SQL 2005 Mobile DB at my place of business, but when I try it at home on my SSL VPN Client connection, I get Hresult -2147012889 ("A request to send data to the computer running IIS has failed."). Typically, a -2147012889 error is a connection issue that relates to resolving the server name.

Here's a snippet:

Dim RemoteConn As String = "Provider=sqloledb; Data Source={company server};" _

& "Initial Catalog={companyDB}; User ID={username}; password={pass}"

'& "Persist Security Info=False;Integrated Security=False"

Dim SourceURL As String = "http://{Company server name}/MobileConnection/sqlcesa30.dll"

Dim SqlRA As New System.Data.SqlServerCe.SqlCeRemoteDataAccess

SqlRA.LocalConnectionString = strConn

SqlRA.InternetUrl = SourceURL

SqlRA.InternetLogin = ""

SqlRA.InternetPassword = ""

SqlRA.CompressionLevel = 3

Try

(Perform Pulls...etc..)

When I pull the sourceURL string and plug it into IE, it works fine. I get the "SQL Server Mobile Server Agent 3.0" message indicating that I have a solid connection over to IIS. That works fine.

But I can't figure out anything in the program. I've rotated the IP address with the name resolution and neither works for me in the program. The difference though when I use the IP address for the server is that I get a slightly different Hresult of -2147012867 (which means you can't connect to the server).

Also, I have IIS configured for anonymous access, the SQL DB I'm trying to pull from isn't restricting access, and my company doesn't have a proxy I need to go through.

Does anyone have any ideas for this issue?

Hi,

Did you find the answer? I have situation almost same as you and I am getting an error too. Do you know any tutorial for RDA using SSL?

Thanks in advance.

Dharam

RDA oleDBConnectionString problem

hi there,
can anyone please show me an example of RDAoleDBConnectionString? i was playing around with RDA, but i cant pull data with my connection string, with an error message
failure to open SQL Server with given connct string. [ connect string =
Data Source = JUN; Initial Catalog = SmartShopper; Integrated Security =True ]
i need a sample of connection string to connect to SQL server 2005, i was using VB 2005 to deploy my project

You need to specify a provider in the OleDb connection string. See http://www.connectionstrings.com/ for examples.

But if you want to connect to a SQL Server, you should probably use the Sql-specific types instead of OleDb.

|||thanks for your reference site...i get quite a lot info there..

RDA and PDA

i am working on a PDA application that uses RDA to push and pull data from
SQL SERVER 2000. I managed to synchronize with GPRS connection . But when i
disable GPRS and activate wireless connection, synchronization fails.
Message is something like that: "request to send data to the computer
running IIS has failed ......... "
I am sure, there is no problem with wireless connection. I can connect to
internet with it.
does anyone have an idea?
thanks so much..
from Pocket IE on your device, try connecting to
the SQL CE server tools dll in the IIS virtual directory.
http://{servername}/{virtualdir}/sscesa20.dll
if it fails, try the IP address.
if that fails, you do not have a valid network path to your server.
Darren Shaffer
..NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
"prefect" <uykusuz@.uykusuz.com> wrote in message
news:eQAF3rR%23FHA.160@.TK2MSFTNGP12.phx.gbl...
>i am working on a PDA application that uses RDA to push and pull data from
>SQL SERVER 2000. I managed to synchronize with GPRS connection . But when i
>disable GPRS and activate wireless connection, synchronization fails.
>Message is something like that: "request to send data to the computer
>running IIS has failed ......... "
> I am sure, there is no problem with wireless connection. I can connect to
> internet with it.
> does anyone have an idea?
> thanks so much..
>