Wed 24 Jun 2009

After extracting sqldeveloper-1.5.4.59.40.zip and executing sqldeveloper.exe, I received following error

---------------------------
Oracle SQL Developer
---------------------------
Unable to create an instance of the Java Virtual Machine
Located at path:
<SQLDEVELOPER>\jdk\jre\bin\client\jvm.dll
---------------------------
OK  
---------------------------

Resolution for this error which works for me, as follow :-


Open ide.conf file from

<SQLDEVELOPER>/jdev/bin/ide.conf
or
<SQLDEVELOPER>\ide\bin\ide.conf


In this file, change this line :
AddVMOption -Xmx512M

by

AddVMOption -Xmx256M

Now, the executable is lauching correctly. No more errors with Java Virtual Machine.

 

Also check the diskspace where sqldeveloper is extracted and available RAM.
You may need to revert back in future if there is no more issue with original file's setting.

 

Tags: ,
Comments (30)
Wed 31 Dec 2008

Sample Code Oracle stored procedure - In this simple implementation, call commit at the end of work done, and Rollback if any exception occur.

 

PROCEDURE SAVE_TWO_THINGS(
IN_THING_ONE IN VARCHAR2,
IN_THING_TWO IN VARCHAR2)
IS

BEGIN

INSERT INTO TABLEONE
(ACTIVE, THING_DESC)
VALUES
('Y', IN_THING_ONE);


INSERT INTO TABLETWO
(ACTIVE, THING_DESC)
VALUES
('N', IN_THING_TWO);

COMMIT;

EXCEPTION WHEN OTHERS THEN 
ROLLBACK;
END;

Comments here
Wed 31 Dec 2008

Today I need to implement transaction in .NET. Front end language was VB.NET and database was Oracle.

This transaction is being implemented using Oracle Data Access Provider - ODP.NET.

Simple implementation is that create and open a connection, begin transaction using that connection, create command using that connection, call stored procedures or statments using command(s), if every thing gone fine and success then call commit of that transaction else rollback, and in last close and dispose connection and transaction.

Be sure not to use commit, rollback or statement that causes transaction invalidate inside the procedure that is being called within .NET transaction, otherwise that .NET transaction scope will no longer valid as within that connection commit or rollback have been called.

Sample code that make my work done is :-

=============

Private Sub Save()
Dim conn As New OracleConnection("ConnString")
Dim trans As OracleTransaction
Dim success as Boolean = False

Try
conn.Open()
 trans = conn.BeginTransaction
success =  saveThingOne(conn)
If success Then
success = saveThingTwo(conn)
End If

If success  Then
 trans.Commit()
else
trans.Rollback()
End If

Catch ex As Exception
 trans.Rollback()
Finally
trans.Dispose()
conn.Close()
conn.Dispose()
End Try
End Sub



Private Sub saveThingOne(ByVal conn As OracleConnection) As Boolean
Dim success as Boolean = False
Using comm As New OracleCommand("Save_Thing_One_Stored_Procedure", conn)
   comm.CommandType = CommandType.StoredProcedure
   comm.Parameters.Add("IN_ID", OracleType.Number).Value = intID
   comm.Parameters.Add("IN_THING_ONE", OracleType.VarChar, 60).Value = strThingONe
   comm.Parameters.Add("OUT_RESULT", OracleType.Number).Direction = ParameterDirection.Output
   comm.ExecuteNonQuery()
‘Here if that procedure successfully perform action then will return 0 in case of success and 1 in case of failure
success = Iif(comm.Parameters(“OUT_RESULT”).Value.ToString().equals(“0”), True, False)
Return success
End Using
End Sub



Private Sub saveThingTwo(ByVal conn As OracleConnection)
Dim success as Boolean = False
Using comm As New OracleCommand("Save_Thing_Two_Stored_Procedure", conn)
   comm.CommandType = CommandType.StoredProcedure
   comm.Parameters.Add("IN_ID", OracleType.Number).Value = intID
   comm.Parameters.Add("IN_THING_TWO", OracleType.VarChar, 60).Value = strThingTwo
   comm.Parameters.Add("OUT_RESULT", OracleType.Number).Direction = ParameterDirection.Output
   comm.ExecuteNonQuery()
‘Here if that procedure successfully perform action then will return 0 in case of success and 1 in case of failure
success = Iif(comm.Parameters(“OUT_RESULT”).Value.ToString().equals(“0”), True, False)
Return success

End Using
End Sub

 

 

Comments here




Ads