GetRows(), GetXML() VS. Oracle Objects...
Hi!
I've been working with OO4O for 2-3 months now. Since the Dynaset is RIDICULOUSLY slow, I always use GetRows() to get my data. But when I call GetRows() in a Dynaset containing objects (i.e. OraObject), all the objects fields are set to Nothing (or Empty string). If I fetch them using the Dynaset itself (not GetRows()), it works. Why ? All the other fields (VARCHAR, NUMBER, DATE) works fine, but not the objects. Here's a copy paste of my watch window, (7,0) and (7,1) are suppose to be objects, but they show up as empty strings. I've looked in the documentation and it doesnt say anything about objects now beeing supported by GetRows().
(0,0) "909349" String
(0,1) "2372636" String
(1,0) "0" String
(1,1) "0" String
(2,0) "87" String
(2,1) "90" String
(3,0) "1" String
(3,1) "1" String
(4,0) "production" String
(4,1) "production" String
(5,0) #10/26/2001 9:22:24 AM# Date
(5,1) #12/10/2001 2:39:45 PM# Date
(6,0) "11" String
(6,1) "11" String
(7,0) "" String
(7,1) "" String
+ (8,0) {System.DBNull} System.DBNull
+ (8,1) {System.DBNull} System.DBNull
Also, I tried using GetXML() as some sort of lame workaround, and I noticed that when I call GetXML() on a dynaset containing objects, only the first object of the table/query is exported. Look at the XML file below, it's the same query. I am 100% sure that DEVICE_ID = 2372636 HAS a COORD value set, but it's not in there.
Debug.WriteLine(s)
<?xml version = "1.0" encoding = "ISO-10646-UCS-2"?>
<ROWSET>
<ROW id="1">
<DEVICE_ID>909349</DEVICE_ID>
<STATUS>0</STATUS>
<ANGLE>87</ANGLE>
<SCALE>1</SCALE>
<LM_USER>production</LM_USER>
<LM_DATETIME>2001-10-26 09:22:24</LM_DATETIME>
<DEV_DEF_ID>11</DEV_DEF_ID>
<COORD>
<SDO_GTYPE>2001</SDO_GTYPE>
<SDO_POINT>
<X>810871,97</X>
<Y>14262677,79</Y>
<Z>0</Z>
</SDO_POINT>
<SDO_ELEM_INFO> </COORD>
</ROW>
<ROW id="2">
<DEVICE_ID>2372636</DEVICE_ID>
<STATUS>0</STATUS>
<ANGLE>90</ANGLE>
<SCALE>1</SCALE>
<LM_USER>production</LM_USER>
<LM_DATETIME>2001-12-10 14:39:45</LM_DATETIME>
<DEV_DEF_ID>11</DEV_DEF_ID>
<COORD>
</COORD>
</ROW>
</ROWSET>
All these OO4O issues are slowing down development. You guys owe me some explanation. PLEASE REPLY FAST!
Mathieu Gauthier
JCMB Technology Inc.
Please note that Metalink is the appropriate forum if you're seeking support from Oracle. These forums are designed for third party developer-to-developer interactions, though Oracle folks may periodically wander by to contribute.
Justin
Similar Messages
-
I have an application that I would like to map bc4j to a object type hierarchy in the database. From reading previous otn threads I'm under the impression that Domains are not used for Oracle Table Types, just for columns based on oracle types. The thread later goes on to say that for the base type (person_typ) I would map a entity object to the table(person_table) mapped to the base type. To map all the sub-types I would create new entity objects and have PersonEO subclassed into StudentEO and EmployeeEO.
I have done this and it's unclear to me when I subclass PersonEO as StudentEO how do I declare that StudentEO is of oracle object type student_typ?
I'm also having problems with inserting data into the base entity obect. Here's code:
PersonVOImpl personVo = am.getPersonVO();
PersonVORowImpl row = (PersonVORowImpl)personVo.createRow();
personVo.insertRow(row);
row.setName("Mark");
row.setPhone("911");
am.getTransaction().commit();
personVo.executeQuery();
while (personVo.hasNext()){
PersonVORowImpl personRow = (PersonVORowImpl)personVo.next();
The data gets comitted to the db correctly but when the code hits personVo.executeQuery() I get the following error:
oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:687)
at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:80)
at oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(OracleSQLBuilderImpl.java:1113)
at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:2017)
at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1013)
at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2309)
at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:2240)
at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:1698)
at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:1552)
at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1008)
at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:2791)
at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2504)
at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2368)
at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2569)
at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:1641)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:577)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:611)
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:593)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:2886)
at model.testing.main(testing.java:33)
Am I coding this correctly? I'm using jdev9032 for this. Are there any examples out there on how to correctly use bc4j with oracle object type tables?
Thanks in advance!
-MarkHere is my ddl:
CREATE TYPE Person_typ AS OBJECT
( name VARCHAR2(30),
address VARCHAR2(100)) NOT FINAL
CREATE TABLE PERSON_TABLE OF PERSON_TYP
I map a entity object to person_table one for one and I edit the SYS_NC_OID$ property of updateable to never.
I then map a view object one for one to the entity object. The jbo trace I get when -Djbo.debugoutput=console is declared is the following (omitted everything before the db connected).[156] Successfully logged in
[157] JDBCDriverVersion: 9.0.1.4.0
[158] DatabaseProductName: Oracle
[159] DatabaseProductVersion: Personal Oracle9i Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production
[160] ViewRowSetImpl's jbo.viewlink.consistent = false (0)
[161] Column count: 3
[162] Executing SQL in generateRefAndOID...
[163] select a.oid, make_ref(PERSON_TABLE, a.oid) from (select /*+ NO_MERGE +*/ sys_op_guid() as oid from dual) a
[164] OracleSQLBuilder Executing DML on: PERSON_TABLE (Insert)
[165] INSERT INTO PERSON_TABLE(NAME,ADDRESS) VALUES (:1,:2)
[166] BaseSQLBuilder: releaseSavepoint 'BO_SP' ignored
[167] PersonVO notify COMMIT ...
[168] Column count: 3
[169] ViewObject : Created new QUERY statement
[170] SELECT REF(PersonTable), PersonTable.NAME, PersonTable.ADDRESS FROM PERSON_TABLE PersonTable
[171] LoadBulkFromResultSet failed (2)
oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
java.lang.Object oracle.jbo.domain.TypeFactory.get(java.lang.Class, java.lang.Class, java.lang.Object)
TypeFactory.java:687
java.lang.Object oracle.jbo.domain.TypeFactory.getInstance(java.lang.Class, java.lang.Object)
TypeFactory.java:80
java.lang.Object[] oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(oracle.jbo.server.AttributeDefImpl[], int, java.sql.ResultSet, int, oracle.jbo.server.DBTransactionImpl)
OracleSQLBuilderImpl.java:1059
void oracle.jbo.server.ViewRowImpl.populate(java.sql.ResultSet)
ViewRowImpl.java:1964
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(oracle.jbo.server.ViewObjectImpl, oracle.jbo.server.QueryCollection, java.sql.ResultSet)
ViewDefImpl.java:1019
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(java.lang.Object, java.sql.ResultSet)
ViewObjectImpl.java:2035
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(oracle.jbo.server.QueryCollection, java.sql.ResultSet)
ViewObjectImpl.java:1966
oracle.jbo.server.ViewRowImpl oracle.jbo.server.QueryCollection.populateRow()
QueryCollection.java:1395
boolean oracle.jbo.server.QueryCollection.fetch(int)
QueryCollection.java:1237
java.lang.Object oracle.jbo.server.QueryCollection.get(int)
QueryCollection.java:832
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.getRow(int)
ViewRowSetImpl.java:2621
void oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(int)
ViewRowSetIteratorImpl.java:2347
void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
ViewRowSetIteratorImpl.java:2211
void oracle.jbo.server.ViewRowSetIteratorImpl.refresh(boolean, boolean)
ViewRowSetIteratorImpl.java:2412
void oracle.jbo.server.ViewRowSetImpl.notifyRefresh(boolean, boolean)
ViewRowSetImpl.java:1556
void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
ViewRowSetImpl.java:548
void oracle.jbo.server.ViewRowSetImpl.executeQuery()
ViewRowSetImpl.java:564
void oracle.jbo.server.ViewObjectImpl.executeQuery()
ViewObjectImpl.java:2616
void mypackage1.testing.main(java.lang.String[])
testing.java:25
Exception in thread main
Process exited with exit code 1.
Please let me know if you need more information.
-Mark -
Hi All
I have oracle object types created.
<code>
CREATE OR REPLACE
TYPE CONFIRM_APP_CONFIRM_ENQUIRY_AT AS OBJECT
ENQATTRIBTYPECODE VARCHAR2(1000),
ENQATTRIBVALUECODE VARCHAR2(1000),
ENQATTRIBSTRINGVALUE VARCHAR2(1000),
ENQATTRIBNUMVALUE NUMBER,
ENQATTRIBDATEVALUE DATE
</code>
I m using this type for couple of columns in a table
and then i try to use this procedure which generates XML
<code>
BEGIN
MY_SQL :=
DBMS_XMLQUERY.NEWCONTEXT
( 'Select Nvl(Enquiry_Number,9999) "EnquiryNumber",
External_System_Reference "ExternalSystemReference",
External_System_Number "ExternalSystemNumber",
Service_Code "ServiceCode",
Subject_Code "SubjectCode",
Enquiry_Description "EnquiryDescription",
Enquiry_Location "EnquiryLocation",
Enquiry_Status_Code "EnquiryStatusCode",
Assigned_Office_Code "AssignedOfficerCode",
Logged_Time "LoggedTime",
EnquiryX "EnquiryX",
EnquiryY "EnquiryY",
Site_Code "SiteCode",
Central_Asset_Id "CentralAssetId",
Contact_Name "ContactName",
Contact_Phone "ContactPhone",
Contact_Fax "ContactFax",
Contact_Email "ContactEmail",
Enquiry_Reference "EnquiryReference",
Enquiry_Class_Code "EnquiryClassCode",
Notice_From_Org_Code "NoticeFromOrgCode",
Works_Reference "WorksReference",
Job_Number "JobNumber",
Address_Reference "AddressReference",
enquiry_attribute1 "EnquiryAttribute",
enquiry_attribute2 "EnquiryAttribute",
enquiry_attribute3 "EnquiryAttribute",
enquiry_attribute4 "EnquiryAttribute",
enquiry_attribute5 "EnquiryAttribute",
enquiry_attribute6 "EnquiryAttribute",
enquiry_attribute7 "EnquiryAttribute",
enquiry_attribute8 "EnquiryAttribute",
enquiry_attribute9 "EnquiryAttribute",
enquiry_attribute10 "EnquiryAttribute",
enquiry_attribute11 "EnquiryAttribute",
enquiry_attribute12 "EnquiryAttribute",
enquiry_attribute13 "EnquiryAttribute",
enquiry_attribute14 "EnquiryAttribute",
enquiry_attribute15 "EnquiryAttribute",
enquiry_attribute16 "EnquiryAttribute",
enquiry_attribute17 "EnquiryAttribute",
enquiry_attribute18 "EnquiryAttribute",
enquiry_attribute19 "EnquiryAttribute",
enquiry_attribute20 "EnquiryAttribute",
enquiry_customer "EnquiryCustomer",
enquiry_document "DocumentLink"
FROM XXHCC_HOLDING_CONFIRM WHERE
EXTERNAL_SYSTEM_REFERENCE ='
|| EXTERNAL_SYSTEM_REFERENCE
|| '
AND message_status = ''FAIL'''
DBMS_XMLQUERY.SETROWSETTAG (MY_SQL, 'Operation');
DBMS_XMLQUERY.SETROWTAG (MY_SQL, 'NewEnquiry');
L_XML := DBMS_XMLQUERY.GETXML (MY_SQL);
DBMS_XMLQUERY.CLOSECONTEXT (MY_SQL);
</code>
when i get the xml as output, i get this..
<code>
<Operation>
<NewEnquiry num="1">
<EnquiryNumber>9999</EnquiryNumber>
<ExternalSystemReference>4343017</ExternalSystemReference>
<ExternalSystemNumber>1</ExternalSystemNumber>
<ServiceCode>HWAY</ServiceCode>
<SubjectCode>MAIN</SubjectCode>
<EnquiryDescription>TAI-Highway Maintenance</EnquiryDescription>
<EnquiryLocation>O/S Cheese Pub</EnquiryLocation>
<LoggedTime>2008-04-09T08:33:36</LoggedTime>
<SiteCode>19101890</SiteCode>
<ContactName>MRS xyz</ContactName>
<ContactPhone>3434343</ContactPhone>
<EnquiryReference>CRMHUB</EnquiryReference>
<NoticeFromOrgCode>ABC</NoticeFromOrgCode>
<WorksReference>4343017</WorksReference>
<EnquiryAttribute>
<ENQATTRIBTYPECODE>CSPL</ENQATTRIBTYPECODE> <ENQATTRIBSTRINGVALUE>n.a</ENQATTRIBSTRINGVALUE>
</EnquiryAttribute>
<EnquiryAttribute>
<ENQATTRIBTYPECODE>CSAI</ENQATTRIBTYPECODE>
<ENQATTRIBSTRINGVALUE>Cracked Path-Loose Flagstone</ENQATTRIBSTRINGVALUE>
</EnquiryAttribute>
<EnquiryAttribute> <ENQATTRIBTYPECODE>CSDL</ENQATTRIBTYPECODE> <ENQATTRIBSTRINGVALUE>No</ENQATTRIBSTRINGVALUE>
</EnquiryAttribute>
<EnquiryAttribute>
<ENQATTRIBTYPECODE>CSIM</ENQATTRIBTYPECODE>
</EnquiryAttribute>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<EnquiryAttribute/>
<ENQUIRY_CUSTOMER>
<CUSTOMER_ALT_PHONE>00</CUSTOMER_ALT_PHONE>
<CUSTOMER_PRIMARY_ADDRESS>,,0, ABC Street</CUSTOMER_PRIMARY_ADDRESS>
<CUSTOMER_TOWN_NAME>UK</CUSTOMER_TOWN_NAME>
<CUSTOMER_COUNTY_NAME>UK</CUSTOMER_COUNTY_NAME>
<CUSTOMER_POST_CODE>AB1 3QT</CUSTOMER_POST_CODE>
</ENQUIRY_CUSTOMER>
</NewEnquiry>
</Operation>
</code>
My question is i m transferring this XML to a third party webservice and it does inserting into a third party application.
The problem is if you look under EnquiryAttribute tag ENQATTRIBSTRINGVALUE and ENQATTRIBTYPECODE i need this to be in lowercase.
As the xml is getting automatically generated how do i achieve this. I feel them in the uppercase is causing problems at the other end.
Any help appreciated
Srini
Message was edited by:
sikhasrinivasUse "..." delimiters in the CREATE TYPE (and in all your code that references the type).
-
How to return Values from Oracle Object Type to Java Class Object
Hello,
i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
CREATE OR REPLACE TYPE person_type AS OBJECT
ID NUMBER,
vorname VARCHAR2(30),
nachname VARCHAR2(30),
geburtstag DATE,
CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
p_nachname VARCHAR2,
p_geburtstag DATE) RETURN SELF AS RESULT,
MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
MEMBER PROCEDURE load_object(p_id NUMBER),
MEMBER PROCEDURE save_object,
MEMBER PROCEDURE insert_object,
MEMBER PROCEDURE update_object,
MEMBER PROCEDURE delete_object
MEMBER PROCEDURE load_object(p_id NUMBER) IS
BEGIN
SELECT p.id, p.vorname, p.nachname, p.geburtstag
INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
FROM person p
WHERE p.id = p_id;
END;
My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
PersonObjectType p = new PersonObjectType();
p.load_object(4);
There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
Thanks a lot.
Edited by: NTbc on 13.07.2010 15:36
Edited by: NTbc on 13.07.2010 15:36CallableStatement =
"DECLARE
a person_type;
BEGIN
a.load_object(4);
? := a;
END;"
And register as an out parameter.
Edited by: michael76 on 14.07.2010 05:01 -
Performance of mapping Oracle objects to Java classes
Hi,
By retrieving some test data from Oracle database in a Java application, I compared the traditional JDBC/RDBMS solution to JPublisher-generated-classes/Oracle-object-tables solution. The underlaying Oracle database and the client environment was the same in both tests. Although the table schemas were different, they represented the same data.
It seems that the traditional JDBC/RDBMS solution is much faster. Is this a reality or did I make a mistake somewhere?
BR,
TimoI am also facing performance overhead when using Jpub generated
classes for the object types.
I am using 817 jdbc and jpub but my database is 816. I have seen
that following statements each take around 2-3 seconds to
execute. Is there any communication between driver and database
to resolve the object type ?
Please help.
cCallableStatement =
(OracleCallableStatement)m_cConnection.prepareCall("{call
list_unsync_appts_array(?,?,?,?,?,?,?,?)}");
((OracleCallableStatement)cCallableStatement).setCustomDatum(1,ct_number_arr);
cCallableStatement.registerOutParameter(2,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
cCallableStatement.registerOutParameter(3,OracleTypes.ARRAY,"T_EVENT_DETAIL_ARR");
cCallableStatement.registerOutParameter(4,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
cCallableStatement.registerOutParameter(5,OracleTypes.ARRAY,"T_EVENT_DETAIL_ARR");
cCallableStatement.registerOutParameter(6,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
cCallableStatement.registerOutParameter(7,OracleTypes.ARRAY,"T_ATTENDEE_EMAIL_ARR");
cCallableStatement.registerOutParameter(8,OracleTypes.ARRAY,"T_ATTENDEE_EMAIL_ARR");
cCallableStatement.execute(); -
How to use Oracle objects in java code
Hi all!
I'm reading an xls and i need to fill me oracle objects with java code:
OBJECT_NAME OBJECT_TYPE
LETTURA_OBJ TYPE
LETTURA_OBJ TYPE BODY
In the past weeks i've been using both java code into oracle and oracle objects, but new i need to write those objects with data i read with java, anybody can help me?
I know that the easiest work around would be to put the data i read from the excel file into a table and then fill the oracle objects, but now i want to learn how to write directly those objects with a command like the following one:
a sample of the code i'm tryng to write:
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
import java.io.*;
import java.io.IOException;
import jxl.*;
public cass ....
#sql{ variabili_globali.var_ER_F3.Tipo_Lettura := 5}
thanks,
Massimo
Edited by: LinoPisto on 16-mag-2011 16.38mmmh i'm not understanding so much....
well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
now, i have this object
CREATE OR REPLACE
TYPE REPORT.FATTURA_OBJ AS OBJECT (
POD VARCHAR2(1000),
ID_FATTURA NUMBER,
ID_FILE NUMBER,
COERENZA_EA_F VARCHAR2(1000),
COERENZA_ER_F VARCHAR2(1000),
COERENZA_EA_M VARCHAR2(1000),
COERENZA_EF_M VARCHAR2(1000),
ANOMALIA VARCHAR2(1000),
MOTIVO_INVALIDAZIONE VARCHAR2(1000),
MATRICOLA_CONTATORE VARCHAR2(1000),
POTENZA_DISPONIBILE VARCHAR2(1000),
MEMBER PROCEDURE pulisci
/and i need to work with it inside this procedure:
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
import java.io.*;
import java.io.IOException;
import java.io.StringWriter;
public class Manage_Excel_ASMBS
public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
**here i need to put what i'm reading inside the excel file into oracle objects**
/can you please give me a sample ?
thanks -
Use of Complex Oracle Object with JDBC
How can I use Oracle Object(or PL/Sql type) with JDBC
I have a structure of record with some attributes and table of another attribute.
My types are defined as follows !
<code>
CREATE TYPE EMPLOYEE_GRADES AS TABLE OF VARCHAR2(50)
CREATE TYPE EMPLOYEES AS OBJECT(EmpName VARCHAR2(50), EmpGrades Employee_Grades)
</code>
My custom object might have the following structure (or should it be different)
<code>
public class EmpColl implements CustomDatum, CustomDatumFactory
-- other stuff ----
/* fields */
public String empName;
public Collection empNos;
</code>
I want to pass an variable of type EMPLOYEES to an procedure.
Thanx in Advance
Chetan
[email protected]<code>
CREATE TYPE EMPLOYEE_GRADES AS TABLE OF VARCHAR2(50)
CREATE TYPE EMPLOYEES AS OBJECT(EmpName VARCHAR2(50), EmpGrades Employee_Grades)
</code>The easiest is to use JPublisher (which comes with the SQLJ distribution).
Say:
jpub -user=username/password -sql=EMPLOYEES:Employees,EMPLOYEE_GRADES:EmployeeGrades
You will get (among others) the Java files Employees.java and EmployeeGrade.java. Go ahead, compile and use them.
Look in [Oracle Home]/sqlj/demo/jpub for a number of additional examples, and in the JPublisher User's Guide for background info.
The next (9.2) release of JPublisher will also provide some support for accessing legacy PL/SQL types from Java. -
Oracle Objects and Domains in Java Server Pages
We have defined this object in a Oracle 816 Enterprise:
CREATE TYPE DESCRIPTOR AS OBJECT
( ID VARCHAR2(30),
DESCRIPTOR VARCHAR2(80))
create TYPE descriptor_table AS VARRAY(30) of DESCRIPTOR
create table foo_test
(foo_test_id varchar2(10),
descrip descriptor_TABLE )
ALTER TABLE foo_test
ADD CONSTRAINT BIBL_test_PK PRIMARY KEY (foo_test_id)
then we have created in JDeveloper 3.1 an Entity (footest) object and a Domain (DescriptorDom) for the type DESCRIPTOR; then set the type of attribute descript to mypackage.DescriptorDom
After that, we created a JavaServer Page as follows:
<jsp:useBean class="oracle.jbo.html.databeans.JSRowSetBrowser" id="abean" scope="request" >
<% abean.setShowCurrentRow(true); abean.setVisibleRows(10); abean.setShowRecordNumbers(true); abean.setReleaseApplicationResources(false); abean.setDisplayAttributes("FooTestId,Descrip"); abean.initialize(pageContext,"ot_logics_LogicsModule.FooTestView");
abean.render();%>
</jsp:useBean>
The execution of JSP shows the error:
java.lang.ClassCastException
void oracle.jbo.domain.Struct.convertArrayToStruct()
java.lang.Object oracle.jbo.domain.Struct.getAttribute(int)
java.lang.String oracle.jbo.domain.Struct.toString()
void oracle.jbo.html.databeans.JSRowSetBrowser.internalInitialize()
void oracle.jdeveloper.html.WebBeanImpl.initialize(javax.servlet.ServletContext, javax.servlet.http.HttpSession,
javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.PrintWriter)
void oracle.jdeveloper.html.DataWebBeanImpl.initialize(javax.servlet.ServletContext, javax.servlet.http.HttpSession,
javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.PrintWriter, java.lang.String)
void oracle.jdeveloper.html.DataWebBeanImpl.initialize(javax.servlet.jsp.PageContext, java.lang.String)
void ot_pages_html.bibl_test._jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext)
void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int,
oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
void oracle.lite.web.JupAppHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
void oracle.lite.web.HTTPServer.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void oracle.lite.web.HTTPServer.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, java.io.OutputStream)
boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, java.io.OutputStream)
void oracle.lite.web.JupHTTPListener$JupHTTP.run()
Please JTeam, could you illuminate me about how implement ORACLE objects in Entity object s and JavaServer Pages?
ps The code generated by JPublisher seems be more complete that done by wizard of Domains. We sould use JPublisher?. How set the attribute type?
Thank in advance.
J LuisHi,
It looks like this might be a bug. I am going to use the information you supplied to file a bug so our QA team can investigate.
We have had problems with arrays of structs, but hope to have them fixed with our next release. -
Oracle Object Types vs. Table Fields
Hello, all.
I`m totally new to Oracle, and I am facing a very hard problem for me, and I would like to ask your help.
I've been working on a project which uses Oracle Object Types, from a database of a legacy system.
I did not know Oracle Objects until 5 minutes ago, so sorry If I say something stupid:
Per my understanding, a Oracle Object Type can be formed by fields like myField varchar(200)... and fields from an existing table or view.
I have a lot of objects on my system and I need to map each field and its respective table or view that compose each object.
Does anyone have a query for that? I think it should be common, but I could not find anything at google (maybe I don`t which terms use to find...)
I would be very thankful if somebody could help (save) me.
Thanks in advance.
PauloFirst, it would help if you post what you object types look like.
I'm assuming they may look something like this:
SQL> create TYPE emp_type AS OBJECT
2 (emp_id NUMBER,
3 name VARCHAR2(20));
4 /
Type created.
SQL> create TYPE emp_tab IS TABLE OF emp_type;
2 /
Type created.
SQL> create or replace package emp_test as
2 procedure get_emps;
3 end emp_test ;
4 /
Package created.
SQL> create or replace package body emp_test as
2 employees emp_tab := emp_tab();
3 procedure get_emps as
4 g_rc sys_refcursor;
5 BEGIN
6 employees.EXTEND(2);
7 employees(1) := emp_type (1, 'John Smith');
8 employees(2) := emp_type (2, 'William Jones');
9 OPEN g_rc FOR
10 SELECT * FROM TABLE (CAST (employees AS emp_tab));
11 END get_emps ;
12 end emp_test ;
13 /
Package body created. -
Oracle Object Views Jdeveloper compatibility
Our application has been designed OOAD and documented in UML. We mapped the UML class diagrams to relational tables and created Oracle object views on top of these tables. From these views we can now generate C++ code with OTT. However, trying to access these views from JDeveloper gives us some problems. Specifically, if an object type defined by "CREATE TYPE xxx AS OBJECT" has a REF column somewhere inside it, there seems to be very little support for this in JDeveloper 10g. Our example is a country with numerous provinces. A provice type has a reference to the country type it falls in. Trying to make a GUI to maintain the provinces gives us no way to select a country to make the REF column from. In JDeveloper, when using the object view to create a maintenance GUI, we see the reference to the country in binary form. Typically we would want to select the country from a drop-down box containing country names instead of binary references. Can someone please point me to documentation describing how to do this or explain here. Thank you in advance.
Not sure if this will be helpful for you, but maybe a better approach for your Java project will be to use TopLink to map your Java objects directly to the relational schema using TopLink's meet-in-the-middle capabilities.
This way you won't need to work with the Object views in the database.
More on TopLink here:
http://www.oracle.com/technology/products/ias/toplink/index.html
Some demos of the mapping capabilities are here:
http://www.oracle.com/technology/products/ias/toplink/mwdemos/index.html
TopLink is very well integrated with JDeveloper 10.1.2 -
Oracle object cols and inserts
hi,
i have a type defined as follows
create type foo
a number(10),
b number(10),
c date, d date);
now i use this in a table as follows
create table test
foo_obj foo default foo(-1, -1, sysdate, sysdate) not null,
foo_name varchar2(100) not null
now what im really interested in is when i do
an insert id like to specify only some of
the values for a given obj
aka
insert into test(foo_obj, foo_name)
values (foo_obj.a(10), 'test')
so the rest of the values for that obj
come from the defaults specified..
ive been unable to find examples for the above method in the 8i docs & any help here
on the correct syntax with an example would
help enormously
thanx
pete
nullOracle® Database Object-Relational Developer's Guide
Also note that object relational database design is often less performant and scalable than relational. It is not very often used in production environments.
However, the object orientated programming feature that is provided with Oracle object feature set are used and can make development and interfaces a lot easier.
So in a nutshell. Say no to ref and nested table columns. Say yes to most of the other object features. IMO of course... -
Oracle object, nested table on a subtype
Hello,
Is it possible to have a nested table on a subtype? If it is, can someone help me?
Here is what I need help for:
I have a supertype WORK, that have:
multivalued attribute ADDRESS
a attribute NAME, also the primary key
The subtype is called EMPLOYEE, that have:
multivalued attribute SPECIALTY
a attribute NAME
a attribute SSN
So far have I got:
//* The supertype *//
create or replace type ADRESS_TP as object(
ADRESS varchar2(50));
create or replace type ADRESSTP as table of ADRESS_TP;
create or replace WORK_TP as object(
NAME varchar2(30),
ADRESS ADRESSTP)
NOT FINAL;
create table WORK_TBL of WORK_TP(
Primary key(NAME))
nested table ADRESS store as NT_ADR(
(Primary key(nested_table_id, ADRESS))
organization index compress);
//* The subtype *//
create or replace type SPECIALTY_TP as object(
ADRESS varchar2(50));
create or replace type SPECIALTYTP as table of SPECIALTY_TP;
create or replace EMPLOYEE_TP under work_tp(
NAME varchar2(30),
SSN number)
FINAL;
The multivalued attribute SPECIALTYTP has to be declared in WORK_TBL have I been told, but how can I do that?
I'm using oracle 9iI'm not really sure what your problem is. In future please be specific about what it is you are trying to do and what it is that is not working. If it's an error please give us the error message and number. It's not the behaviour you are expecting please describe what it does. If it's that you simply don't understand please say what you don't understand.
I go on like this because the code you have posted is somewhat confusing. The Oracle object-oriented implementation is not quite complete so that makes it hard for people who know OO but don't know Oracle. Whereas most of us who know Oracle aren't expert in OO. Also, I think you should be slightly more inventive in your names: there's so many things called ADRESS it's easy to get them tangled up.
Anyway, here's my guess at what I think your problem is....
SQL> CREATE OR REPLACE TYPE adress_t AS OBJECT(
2 line1 VARCHAR2(50)
3 ,line2 VARCHAR2(50)
4 ,postcode VARCHAR2(8));
5 /
Type created.
SQL>
SQL> CREATE OR REPLACE TYPE adress_nt AS TABLE OF adress_t;
2 /
Type created.
SQL> CREATE OR REPLACE TYPE work_t AS OBJECT(
2 name VARCHAR2(30),
3 adresses adress_nt)
4 NOT FINAL;
5 /
Type created.
SQL> CREATE TABLE work_tbl OF work_t
2 NESTED TABLE adresses STORE AS adress_ntab
3 /
Table created.
SQL> CREATE OR REPLACE TYPE specialty_t AS OBJECT(
2 description VARCHAR2(50));
3 /
Type created.
SQL> CREATE OR REPLACE TYPE specialty_nt AS TABLE OF specialty_t;
2 /
Type created.
SQL>
SQL> ALTER TYPE work_t ADD ATTRIBUTE specialities specialty_nt CASCADE
2 /
Type altered.
SQL> DESC work_tbl
Name Null? Type
NAME VARCHAR2(30)
ADRESSES ADRESS_NT
SPECIALITIES SPECIALTY_NT
SQL> Cheers, APC -
Help on accessing Oracle object !
Hi,
Looking for a help in accessing oracle object using JDBC. I've the following object defined in Oracle.
TYPE ty_ctg_prod AS OBJECT(
PROD VARCHAR2(40 ),
NODE_ID NUMBER ,
CTG_ID NUMBER );
TYPE ctg_PROD_ary AS VARRAY (50) OF ty_ctg_PROD;
The procedure out parameter is returning :
x_ctg_prod_ary OUT ctg_prod_ary
Do I need to use a OracleTypes.STRUCT API Or oracle.sql.ARRAY to access data in this scenario.
Any pointers will be highly appreciated.
Thanks,
Shamik// Get the object1 value from the second column col_object1
oracle.sql.STRUCT object1 = (oracle.sql.STRUCT)collabstatement.getObject(2);
// Get the object1 values from each row
Object[] object1Values = object1.getAttributes();
// Get the first value of object1, which is a string
String str = (String)object1Values[0];
// Get the second value of object1, which is of the type object2
oracle.sql.STRUCT object2 = (oracle.sql.STRUCT)object1Values[1];
// Get the values of object2
Object object2Values[] = object2.getAttributes();
str = (String)object2Values[0];
BigDecimal num = (BigDecimal)object2Values[1];you can also use :oracle.sql.Datum[] attrs = oracleSTRUCT.getOracleAttributes();more info :
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/objects/ObjectTypes.html -
Working with oracle object type tables
Hi,
I've created a table which only contains Oracle object types (e.g. CREATE TABLE x OF <...>). When I create an Entity for this table using the Entity wizard, I end up with an entity with the attributes of the base object type and two special attributes REF$ (reference to the object type instance) and SYS_NC_OID$ (unique object identifier). The REF$ attribute is on the Java side of type oracle.jbo.domain.Ref and the other attribute is on the Java side a simple String.
It seems this only allows me to save objects of the base type in this table. First of all in my situation this is also impossible because the base type is not instantiable. What I do want is to save several different subtypes into this table using the BC4J custom domain mechanism. Is there any way to make this possible? I first thought I could maybe do something with the special REF$ attribute, but this doesn't seem te case. So I might need to override most of the EntityImpl methods, like doUML, remove etc. Am I right? And does anyone have any hints on how to do this?
Regards,
PeterPeter:
Hi,
I've created a table which only contains Oracle
object types (e.g. CREATE TABLE x OF <...>).
When I create an Entity for this table using the
Entity wizard, I end up with an entity with the
attributes of the base object type and two special
attributes REF$ (reference to the object type
instance) and SYS_NC_OID$ (unique object identifier).
The REF$ attribute is on the Java side of type
oracle.jbo.domain.Ref and the other attribute is on
the Java side a simple String.
It seems this only allows me to save objects of the
base type in this table. First of all in my situation
this is also impossible because the base type is not
instantiable. What I do want is to save several
different subtypes into this table using the BC4J
custom domain mechanism. Is there any way to make
this possible? Sorry, but this is not supported out of the box.
Since you have an object table, you wouldn't use domains to achieve this. Instead, you would have a superclass and subclass entity objects, e.g., PersonEO subclassed into StudentEO and EmployeeEO.
I first thought I could maybe do
something with the special REF$ attribute, but this
doesn't seem te case. So I might need to override
most of the EntityImpl methods, like doUML, remove
etc. Am I right? And does anyone have any hints on
how to do this?
If you want, you can try this by overridding EntityImpl's:
protected StringBuffer buildDMLStatement(int operation,
AttributeDefImpl[] allAttrs,
AttributeDefImpl[] retCols,
AttributeDefImpl[] retKeys,
boolean batchMode)
and
protected int bindDMLStatement(int operation,
PreparedStatement stmt,
AttributeDefImpl[] allAttrs,
AttributeDefImpl[] retCols,
AttributeDefImpl[] retKeys,
HashMap retrList,
boolean batchMode) throws SQLException
Handle the case when operation == DML_INSERT.
There, build an insert statement with substitutable row, e.g.:
INSERT INTO persons VALUES (person_t('Bob', 1234));
INSERT INTO persons VALUES (employee_t('Joe', 32456, 12, 100000));
where person_t and employee_t are database types and you are invoking the respective constructor.
Thanks.
Sung -
Concurrency and Oracle Object Types
Hi All,
I have a question regarding Concurrent usage of an Object type in Oracle.
I have a java program which calls an Oracle stored proc with the object's table type as IN parameter. In my stored proc, I am populating an Oracle Object with data received from java and retrieving some data based on that.
My java program can be invoked concurrently by 500 users at the same time - the application is built to handle that request load.
Now in Oracle, if a bunch of requests are received at the same, would Oracle create multiple instances of this object type that would be usage to the multiple stored proc invocations? Or would there be a prob of concurrency?
If multiple instance creation is not supported, is there some alternative I can use?
My code roughly resembles:
Object:
contains two columns - name, age
Stored proc - logic to retrieve and return data from a table based on the name, age received.
When a bunch of requests access the stored proc simultaneously, will a bunch of instnaces of the object type get created? Or would there be a scenario where the object is common to all requests and hence data from one request would be conflicted due to data from another request?Hi Wiiliam
Sorry for the late acknowledgement (i dozed off!).. Thanks for the response. So the private instance specific to a session ensure that theres no conflict between multiple requests to the same stored proc and hence no conflict of data... Great
Chaitanya -
ORACLE OBJECTS FOR OLE(OO4O) PERFORMANCE TUNING
제품 : ORACLE SERVER
작성날짜 : 1997-10-10
ODBC의 경우는 Block단위로 data를 Query하는데 비해 OLE의 경우는 한번에 전체
의 자료를 가져다가 Temporary storage space에 넣게 됩니다.
그래서 튜닝을 위해서는
Windows 3.1의 경우는 c:/windows/oraole.ini
WIN95의 경우는 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OO4O
parameters를 수정해야 합니다.
만일 위의 File이 없는 경우는 모든 변수가 Default로 설정된 경우이므로 인스톨
된 Help를 자세히 읽어보고 적용을 해야합니다.
FetchLimit이 가장 큰 영향을 끼치는 파라미터로, 일반적으로 이 값이 클수록
속도가 빨라지게 됩니다. 다음은 관련 자료입니다.
Tuning and Customization
A number of working parameters of Oracle Objects for OLE can be
customized. Access to these parameters is provided through the Oracle
initialization file, by default named ORAOLE.INI.
Each entry currently available in that file is described below. The location
of the ORAOLE.INI file is specified by the ORAOLE environment variable.
Note that this variable should specify a full pathname to the Oracle
initialization file, which is not necessarily named ORAOLE.INI. If this
environment variable is not set, or does not specify a valid file entry, then
Oracle Objects for OLE looks for a file named ORAOLE.INI in the Windows
directory. If this file does not exist, all of the default values
listed will apply.
You can customize the following sections of the ORAOLE.INI file:
[Cache Parameters]
A cache consisting of temporary data files is created to manage amounts
of data too large to be maintained exclusively in memory. This cache
is needed primarily for dynaset objects, where, for example, a single
LONG RAW column can contain more data than exists in physical
(and virtual) emory.
The default values have been chosen for simple test cases, running on a machine
with limited Windows resources. Tuning with respect to your machine and
applications is recommended.
Note that the values specified below are for a single cache, and that a separate
cache is allocated for each object that requires one. For example, if
your application contains three dynaset objects, three independent data
caches are constructed, each using resources as described below.
SliceSize = 256 (default)
This entry specifies the minimum number of bytes used to store a piece
of data in the cache. Items smaller than this value are allocated the
full SliceSize bytes for storage; items larger than this value are
allocated an integral multiple of this space value. An example of an
item to be stored is a field value of a dynaset.
PerBlock = 16 (default)
This entry specifies the number of Slices (described in the preceding
entry) that are stored in a single block. A block is the minimum unit
of memory or disk allocation used within the cache. Blocks are read
from and written to the disk cache temporary file in their entirety. Assuming a SliceSize of 256 and a PerBlock value of 16, then the block
size is 256 * 16 = 4096 bytes.
CacheBlocks = 20 (default)
This entry specifies the maximum number of blocks held in memory at any
one time. As data is added to the cache, the number of used blocks
grows until the value of CacheBlocks is reached. Previous blocks are
swapped from memory to the cache temporary disk file to make room for
more blocks. The blocks are swapped based upon recent usage. The total
amount of memory used by the cache is calculated as the product of
(SliceSize * PerBlock * CacheBlocks).
Recommended Values: You may need to experiment to find optimal cache parameter
values for your applications and machine environment. Here are some guidelines
to keep in mind when selecting different values:
The larger the (SliceSize * PerBlock) value, the more disk I/O is
required for swapping individual blocks. The smaller the (SliceSize * PerBlock) value, the
more likely it is that blocks will need to be swapped to or from disk.
The larger the CacheBlocks value, the more memory is required, but the
less likely it is that Swapping will be required.
A reasonable experiment for determining optimal performance might
proceed as follows:
Keep the SliceSize >= 128 and vary PerBlock to give a range of block
sizes from 1K through 8K.
Vary the CacheBlocks value based upon available memory. Set it high
enough to avoid disk I/O, but not so high that Windows begins swapping
memory to disk.
Gradually decrease the CacheBlocks value until performance degrades or
you are satisfied with the memory usage. If performance drops off,
increase the CacheBlocks value once again as needed to restore
performance.
[Fetch Parameters]
FetchLimit = 20 (default)
This entry specifies the number of elements of the array into which data
is fetched from Oracle. If you change this value, all fetched values
are immediately placed into the cache, and all data is retrieved from
the cache. Therefore, you should create cache parameters such that all
of the data in the fetch arrays can fit into cache memory. Otherwise,
inefficiencies may result.
Increasing the FetchLimit value reduces the number of fetches (calls
to the database) calls and possibly the amount of network traffic.
However, with each fetch, more rows must be processed before user
operations can be performed. Increasing the FetchLimit increases
memory requirements as well.
FetchSize = 4096 (default)
This entry specifies the size, in bytes, of the buffer (string) used for
retrieved data. This buffer is used whenever a long or long raw column
is initially retrieved.
[General]
TempFileDirectory = [Path]
This entry provides one method for specifying disk drive and directory
location for the temporary cache files. The files are created in the
first legal directory path given by:
1.The drive and directory specified by the TMP environment variable
(this method takes precedence over all others);
2.The drive and directory specified by this entry (TempFileDirectory)
in the [general] section of the ORAOLE.INI file;
3.The drive and directory specified by the TEMP environment variable; or
4.The current working drive and directory.
HelpFile = [Path and File Name]
This entry specifies the full path (drive/path/filename) of the Oracle Objects
for OLE help file as needed by the Oracle Data Control. If this entry cannot
be located, the file ORACLEO.HLP is assumed to be in the directory where
ORADC.VBX is located
(normally \WINDOWS\SYSTEM).제품 : ORACLE SERVER
작성날짜 : 1997-10-10
ODBC의 경우는 Block단위로 data를 Query하는데 비해 OLE의 경우는 한번에 전체
의 자료를 가져다가 Temporary storage space에 넣게 됩니다.
그래서 튜닝을 위해서는
Windows 3.1의 경우는 c:/windows/oraole.ini
WIN95의 경우는 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OO4O
parameters를 수정해야 합니다.
만일 위의 File이 없는 경우는 모든 변수가 Default로 설정된 경우이므로 인스톨
된 Help를 자세히 읽어보고 적용을 해야합니다.
FetchLimit이 가장 큰 영향을 끼치는 파라미터로, 일반적으로 이 값이 클수록
속도가 빨라지게 됩니다. 다음은 관련 자료입니다.
Tuning and Customization
A number of working parameters of Oracle Objects for OLE can be
customized. Access to these parameters is provided through the Oracle
initialization file, by default named ORAOLE.INI.
Each entry currently available in that file is described below. The location
of the ORAOLE.INI file is specified by the ORAOLE environment variable.
Note that this variable should specify a full pathname to the Oracle
initialization file, which is not necessarily named ORAOLE.INI. If this
environment variable is not set, or does not specify a valid file entry, then
Oracle Objects for OLE looks for a file named ORAOLE.INI in the Windows
directory. If this file does not exist, all of the default values
listed will apply.
You can customize the following sections of the ORAOLE.INI file:
[Cache Parameters]
A cache consisting of temporary data files is created to manage amounts
of data too large to be maintained exclusively in memory. This cache
is needed primarily for dynaset objects, where, for example, a single
LONG RAW column can contain more data than exists in physical
(and virtual) emory.
The default values have been chosen for simple test cases, running on a machine
with limited Windows resources. Tuning with respect to your machine and
applications is recommended.
Note that the values specified below are for a single cache, and that a separate
cache is allocated for each object that requires one. For example, if
your application contains three dynaset objects, three independent data
caches are constructed, each using resources as described below.
SliceSize = 256 (default)
This entry specifies the minimum number of bytes used to store a piece
of data in the cache. Items smaller than this value are allocated the
full SliceSize bytes for storage; items larger than this value are
allocated an integral multiple of this space value. An example of an
item to be stored is a field value of a dynaset.
PerBlock = 16 (default)
This entry specifies the number of Slices (described in the preceding
entry) that are stored in a single block. A block is the minimum unit
of memory or disk allocation used within the cache. Blocks are read
from and written to the disk cache temporary file in their entirety. Assuming a SliceSize of 256 and a PerBlock value of 16, then the block
size is 256 * 16 = 4096 bytes.
CacheBlocks = 20 (default)
This entry specifies the maximum number of blocks held in memory at any
one time. As data is added to the cache, the number of used blocks
grows until the value of CacheBlocks is reached. Previous blocks are
swapped from memory to the cache temporary disk file to make room for
more blocks. The blocks are swapped based upon recent usage. The total
amount of memory used by the cache is calculated as the product of
(SliceSize * PerBlock * CacheBlocks).
Recommended Values: You may need to experiment to find optimal cache parameter
values for your applications and machine environment. Here are some guidelines
to keep in mind when selecting different values:
The larger the (SliceSize * PerBlock) value, the more disk I/O is
required for swapping individual blocks. The smaller the (SliceSize * PerBlock) value, the
more likely it is that blocks will need to be swapped to or from disk.
The larger the CacheBlocks value, the more memory is required, but the
less likely it is that Swapping will be required.
A reasonable experiment for determining optimal performance might
proceed as follows:
Keep the SliceSize >= 128 and vary PerBlock to give a range of block
sizes from 1K through 8K.
Vary the CacheBlocks value based upon available memory. Set it high
enough to avoid disk I/O, but not so high that Windows begins swapping
memory to disk.
Gradually decrease the CacheBlocks value until performance degrades or
you are satisfied with the memory usage. If performance drops off,
increase the CacheBlocks value once again as needed to restore
performance.
[Fetch Parameters]
FetchLimit = 20 (default)
This entry specifies the number of elements of the array into which data
is fetched from Oracle. If you change this value, all fetched values
are immediately placed into the cache, and all data is retrieved from
the cache. Therefore, you should create cache parameters such that all
of the data in the fetch arrays can fit into cache memory. Otherwise,
inefficiencies may result.
Increasing the FetchLimit value reduces the number of fetches (calls
to the database) calls and possibly the amount of network traffic.
However, with each fetch, more rows must be processed before user
operations can be performed. Increasing the FetchLimit increases
memory requirements as well.
FetchSize = 4096 (default)
This entry specifies the size, in bytes, of the buffer (string) used for
retrieved data. This buffer is used whenever a long or long raw column
is initially retrieved.
[General]
TempFileDirectory = [Path]
This entry provides one method for specifying disk drive and directory
location for the temporary cache files. The files are created in the
first legal directory path given by:
1.The drive and directory specified by the TMP environment variable
(this method takes precedence over all others);
2.The drive and directory specified by this entry (TempFileDirectory)
in the [general] section of the ORAOLE.INI file;
3.The drive and directory specified by the TEMP environment variable; or
4.The current working drive and directory.
HelpFile = [Path and File Name]
This entry specifies the full path (drive/path/filename) of the Oracle Objects
for OLE help file as needed by the Oracle Data Control. If this entry cannot
be located, the file ORACLEO.HLP is assumed to be in the directory where
ORADC.VBX is located
(normally \WINDOWS\SYSTEM).
Maybe you are looking for
-
Activation of links to embedded ".kmz" and "Animated GIF" files.
I recently upgraded from Adobe Acrobat Pro X to Adobe Acrobat Pro XI and noticed a slight difference on how documents linked in an Adobe Acrobat File are activated for display. I have placed files I want to display in my Adobe Acrobat file as file a
-
Regarding XI installation and Learning
Hi All, I am very new to XI and i want to get into XI domain. At present i am actually into SAP-ABAP from 2 years. As i want to learn XI so i want some suggestions from all you guys familiar with XI. I have some questions regarding XI. 1. What is the
-
Two JSplitPanes sharing single JPanel...
Say I have JPanels 1,2 and 3. I want JPanel 1 on top with a splitPane dividing it and Panel 2. THen I want JPanel 2 and 3 to be divided w/ another JSplitPanel . I can't seem to get this to work. Here's a little pseudo of what I'm doing. JPanel jp1,jp
-
My account has been split, can't fix it.
My account has been split exactly as as described in the thread titled "Why has my account spawned a similar identity?". My original account screen name set up ages ago is "gatorjim2000". The split account name is "gatorjim2000-ehBrrD". The gatorjim2
-
Zen Nano Plus Volume (I know this is not n
The problem of the minimum volume of /25 being too loud for many still exists. I would like to ask if it is possible to reverse this glitch even if a new firmware if released? Or does the mp3 player, being a flash player mean that once it's done, it'