Search found 5 matches

by DaGoat
Sun 18 Jan 2009 05:36
Forum: dotConnect for Oracle
Topic: Attempted to read or write protected memory
Replies: 4
Views: 7751

I take it, that this is something not seen before. Ok, let me try to give you as much info as possible.

OraConnect Version: 5.0.12.0
Visual Studio Version: 2008
Oracle Version: 9i .2 (some patch number)

Select Statement, and I stress that it seems to happen here the most, as other areas it happens as well.

Statement: Select CODEID from FILESTORAGE Where ID = 1312
CODEID field is Defined as VarChar(10) , ID field is numeric.

This error is impossible to reproduce at will, and it seems to happen once a day. I have check my code over and over again trying to figure this out. I know you are probably going to do the same and say that it is impossible to tell what causes this. I think it has something to do with Oracle itself or some other source. But I appreciate any help I can get. I have checked around with other forums and data connectors and this is an error that no one has been able to put a finger on. It seems to affect other Oracle Data Connection Venders including a regular .NET ODBC driver for Oracle. Below is the simple code that is executed when this takes place.

Try
Dim dt As New DataTable

Using cn As New Devart.Data.Oracle.OracleConnection(ConnectionString)
cn.Open()

Using cm As New Devart.Data.Oracle.OracleCommand(sqlStatement, cn)
Using da As New Devart.Data.Oracle.OracleDataAdapter(cm)
da.Fill(dt)
End Using
End Using

End Using

Return dt
Catch ex As Exception
Throw
End Try


Now, I do have the application in layers, Business and Data Access DLLs, and a UI layer (EXE). Business Layer calls data access witch runs the above code.

Thank you for taking the time.
by DaGoat
Thu 15 Jan 2009 19:22
Forum: dotConnect for Oracle
Topic: Attempted to read or write protected memory
Replies: 4
Views: 7751

Attempted to read or write protected memory

Ok, I get this error sometimes and it is becoming a problem with my customers. I hope there is a fix for this or some kind of solution. In other words, Please Help !!

This seems to happen on a simple Statement - "Select FIELDS from TABLE Where ID = 1234". Like I said, it happens maybe 1 in a 1000 calls to the databse.

Error Follows:
-------------------------------
Exception Message: Devart.Data.Oracle.OracleException: Internal exception in Oracle client occurred. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at OciDynamicType.nativea(HandleRef , HandleRef , HandleRef , Int32 ,
Int32 , Int32 , Int32 , Int32 )
at OciDynamicType.a(HandleRef , HandleRef , HandleRef , Int32 , Int32 ,
Int32 , Int32 , Int32 )
at Devart.Data.Oracle.an.a(Int32 A_0, a2 A_1)
--- End of inner exception stack trace ---
at Devart.Data.Oracle.an.a(Int32 A_0, a2 A_1)
at Devart.Data.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBeha
vior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at Devart.Data.Oracle.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
----------------------------

HELP!!!
by DaGoat
Thu 04 Dec 2008 05:35
Forum: dotConnect for Oracle
Topic: How to do Row Locking
Replies: 4
Views: 2011

Good Deal, that did the trick.

Appreciated it.
by DaGoat
Mon 01 Dec 2008 13:10
Forum: dotConnect for Oracle
Topic: How to do Row Locking
Replies: 4
Views: 2011

Ok, So is there another way of locking a record so others have to wait until it is released? Or is the FOR UPDATE the only way?
by DaGoat
Wed 26 Nov 2008 21:12
Forum: dotConnect for Oracle
Topic: How to do Row Locking
Replies: 4
Views: 2011

How to do Row Locking

Ok,
To summarize, I am trying to Lock a record so I can get the value of a column and then edit that value without other users grabbing the same value. To make this happen I would use the “FOR UPDATE clause in my Select Statement to lock the record (Using System.Data.OracleClient namespace).

Now I have converted the project to use your dotConnect for Oracle. How can I do the same with your product? I tried to use the “FOR UPDATE” clause and I get and error “ORA-01002: fetch out of sequence”.

Steps I Need:
1. Get the Value of the column in a table and lock it so no one else can obtain the same record or value.
2. Update the value.
3. Basically done. Release the lock and go on about our merry way.

Code I would like to Run: (VB.NET)

Dim sqlText As String = _
"Select VALUETOCHANGE, PRIMARYCOLUMN " & _
"From MYTABLE " & _
"Where PRIMARYCOLUMN = 'SomeValue' FOR UPDATE "

Dim updateText As String = _
"Update MYTABLE Set " & _
"VALUETOCHANGE= (VALUETOCHANGE +1) " & _
"Where PRIMARYCOLUMN = 'SomeValue'"

Dim value As Integer
Dim dt As New DataTable

Try
Using cn As New OracleConnection(myConnectionString)
cn.Open()
Using cm As New OracleCommand(sqlText, cn)
Using da As New OracleDataAdapter(cm)
da.Fill(dt)
value = CInt(dt.Rows(0)(2))
cm.CommandText = updateText
cm.ExecuteNonQuery()
End Using
End Using
End Using
Catch ex As Exception
Throw
End Try

Return value