Caching Result Set ?
folks
I have a search page which returns a result set and the results are put in the session to be able to access when user clicks on the page numbers(pagination) in the results pane.
Is there any way we can store or cache this and access instead of fetching it off the session.
You can store the data as a multi dimensional array in javascript on the rendered jsp page as a javascript function. It exists on the client side (browser) and you can use an onClick event on the page's button to call up various parts of the array and display it to the user. That way, your user doesnt have to submit the page back to the servlet to pagenate to the next page. The data shows up immidiately instead. You'll have to read up on javascript to learn how to do this. (Also I assume you are storing the resultant data in some type of array and not the raw resultSet).
However, if so much data is returned to the user he needs pagenation, I suggest you add filter textfields to allow him to limit what data is returned so pagenation is not needed. Pagenation implies there is too much data for the user to effectively use at once (no one likes scrolling down a list of 200 items). For instance, instead of displaying all names in a list, add a filter so the user can search for all last names that begain with an A, or B, etc through Z. Then, when displayed to the user, show the list sorted by your filter criteria (lastName). If there is still too much data in the list, I suggest putting up a vertical scrollbar rather than pagenation.
Similar Messages
-
Olap cache not storing result sets for certain queries
Hi - another cache question
my result set for a query is not getting set in OLAP CACHE - the query variable level is stored ok but not the result set.
different queries store the result sets ok.
there is nothing in the query or cube properties that should disable the caching of the result set.
there is plenty of space available and there has not been any changes to the query or data loaded or aggregates changed.
any ideas?
cheers - NeilI would do a performance check in RSRT2. This will usually give you some additional information related to olap cache.
Hope that helps. -
11g Client result set caching in OCI
I'm trying out this feature in the 11.1.0.6 release. My understanding of this feature is that when enabled with the appropriate server-side init.ora parameters, a 11g OCI client connecting to the instance will cache SQL results locally in some fixed amount of RAM on the client. The idea is that network roundtrips would simply disappear in this situation.
I'm not sure if it's working--or how to tell if it is. I have a 11g instance running and put the 11g client incl. sqlplus on a separate box, setting up TNS connectivity from client to server. Pretty standard stuff. I can connect fine and run the same query over and over, but I see incrementing execution counts on the database side and network traffic between the client and server so I'm guessing that the client-side caching isn't happening. There doesn't seem to be a ton of clear documentation on this feature so I wanted to see if anyone else has kicked it around.
BobI am also facing the same issue (enabling client result set caching). I am using Oracle Database 11g Release 11.2.0.2.0.
I have made the below configuration changes
1. Enabled the client result set cache by setting the server side parameter 'client_result_cache_size' to 10485760 (10 MB)
2. Restarted the oracle instance after setting the above parameter
3. Added a table annotation by executing the statement ALTER TABLE emp RESULT_CACHE (MODE FORCE). I verified that the annotation is applied by query the user table later.
4. Enabled statement caching on the client side i.e. on the JDBC driver.
5. Used prepared statements to execute the query so that statement caching kicks in. From the driver logs I verified that execution of subsequent queries after the first one used the same statement handle.
After executing the select prepared statement query for three times I checked the CLIENT_RESULT_CACHE_STATS$ view. But this view didn't result in any rows.
As part of troubleshooting I even tried adding the /*+ RESULT_CACHE */ hint to the query but the view didn't gave any result.
Also on enabling sql trace I could see from tkprof that every execution of the query increased the number of rows fetched on the server which indicates that the client result set caching in OCI isn't working.
Are there any steps which I have missed?
Thanks in advance. -
i want to store some result set(select clause) into cache and reuse into latter part.
kindly help me out.(oracle 10g)
Edited by: anutosh on Oct 12, 2009 6:11 AMi am inserting value into 2 tables
'INSERT INTO ' ||
in_fct_table ||
' NOLOGGING SELECT * FROM ' ||
in_fct_table ||
'_STG PARTITION(' ||
f_pop_partition.partition_name ||
') LOG ERRORS INTO ' ||
in_fct_table ||
'_D(''' ||
f_pop_partition.partition_name ||
''') REJECT LIMIT UNLIMITED';
duplicates data stored in <_ d> (suffix) table and remaining data(without duplicate) want to store in in_fct_tables(variable name) based on some partition.
data from in_fct_tables(variable name) table want to populate into some other table . so for that we need to capture the data from in_fct_table. -
Hello,
I try to get the client side result set cache working, but i have no luck :-(
I'm using Oracle Enterprise Edition 11.2.0.1.0 and as client diver 11.2.0.2.0.
Executing the query select /*+ result_cache*/ * from p_item via sql plus or toad will generate an nice execution plan with an RESULT CACHE node and the v$result_cache_objects contains some rows.
After I've check the server side cache works. I want to cache the client side
My simple Java Application looks like
private static final String ID = UUID.randomUUID().toString();
private static final String JDBC_URL = "jdbc:oracle:oci:@server:1521:ORCL";
private static final String USER = "user";
private static final String PASSWORD = "password";
public static void main(String[] args) throws SQLException {
OracleDataSource ds = new OracleDataSource();
ds.setImplicitCachingEnabled(true);
ds.setURL( JDBC_URL );
ds.setUser( USER );
ds.setPassword( PASSWORD );
String sql = "select /*+ result_cache */ /* " + ID + " */ * from p_item d " +
"where d.i_size = :1";
for( int i=0; i<100; i++ ) {
OracleConnection connection = (OracleConnection) ds.getConnection();
connection.setImplicitCachingEnabled(true);
connection.setStatementCacheSize(10);
OraclePreparedStatement stmt = (OraclePreparedStatement) connection.prepareStatement( sql );
stmt.setLong( 1, 176 );
ResultSet rs = stmt.executeQuery();
int count = 0;
for(; rs.next(); count++ );
rs.close();
stmt.close();
System.out.println( "Execution: " + getExecutions(connection) + " Fetched: " + count );
connection.close();
private static int getExecutions( Connection connection ) throws SQLException {
String sql = "select executions from v$sqlarea where sql_text like ?";
PreparedStatement stmt = connection.prepareStatement(sql);
stmt.setString(1, "%" + ID + "%" );
ResultSet rs = stmt.executeQuery();
if( rs.next() == false )
return 0;
int result = rs.getInt(1);
if( rs.next() )
throw new IllegalArgumentException("not unique");
rs.close();
stmt.close();
return result;
100 times the same query is executed and the statement exection count is incemented every time. I expect just 1 statement execution ( client database roundtrip ) and 99 hits in client result set cache. The view CLIENT_RESULT_CACHE_STATS$ is empty :-(
I'm using the oracle documentation at http://download.oracle.com/docs/cd/E14072_01/java.112/e10589/instclnt.htm#BABEDHFF and I don't kown why it does't work :-(
I'm thankful for every tip,
André KullmannI wanted to post a follow-up to (hopefully) clear up a point of potential confusion. That is, with the OCI Client Result Cache, the results are indeed cached on the client in memory managed by OCI.
As I mentioned in my previous reply, I am not a JDBC (or Java) expert so there is likely a great deal of improvement that can be made to my little test program. However, it is not intended to be exemplary, didactic code - rather, it's hopefully just enough to illustrate that the caching happens on the client (when things are configured correctly, etc).
My environment for this exercise is Windows 7 64-bit, Java SE 1.6.0_27 32-bit, Oracle Instant Client 11.2.0.2 32-bit, and Oracle Database 11.2.0.2 64-bit.
Apologies if this is a messy post, but I wanted to make it as close to copy/paste/verify as possible.
Here's the test code I used:
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleDataSource;
import oracle.jdbc.OracleConnection;
class OCIResultCache
public static void main(String args []) throws SQLException
OracleDataSource ods = null;
OracleConnection conn = null;
PreparedStatement stmt = null;
ResultSet rset = null;
String sql1 = "select /*+ no_result_cache */ first_name, last_name " +
"from hr.employees";
String sql2 = "select /*+ result_cache */ first_name, last_name " +
"from hr.employees";
int fetchSize = 128;
long start, end;
try
ods = new OracleDataSource();
ods.setURL("jdbc:oracle:oci:@liverpool:1521:V112");
ods.setUser("orademo");
ods.setPassword("orademo");
conn = (OracleConnection) ods.getConnection();
conn.setImplicitCachingEnabled(true);
conn.setStatementCacheSize(20);
stmt = conn.prepareStatement(sql1);
stmt.setFetchSize(fetchSize);
start = System.currentTimeMillis();
for (int i=0; i < 10000; i++)
rset = stmt.executeQuery();
while (rset.next())
if (rset != null) rset.close();
end = System.currentTimeMillis();
if (stmt != null) stmt.close();
System.out.println();
System.out.println("Execution time [sql1] = " + (end-start) + " ms.");
stmt = conn.prepareStatement(sql2);
stmt.setFetchSize(fetchSize);
start = System.currentTimeMillis();
for (int i=0; i < 10000; i++)
rset = stmt.executeQuery();
while (rset.next())
if (rset != null) rset.close();
end = System.currentTimeMillis();
if (stmt != null) stmt.close();
System.out.println();
System.out.println("Execution time [sql2] = " + (end-start) + " ms.");
System.out.println();
System.out.print("Enter to continue...");
System.console().readLine();
finally
if (rset != null) rset.close();
if (stmt != null) stmt.close();
if (conn != null) conn.close();
}In order to show that the results are cached on the client and thus server round-trips are avoided, I generated a 10046 level 12 trace from the database for this session. This was done using the following database logon trigger:
create or replace trigger logon_trigger
after logon on database
begin
if (user = 'ORADEMO') then
execute immediate
'alter session set events ''10046 trace name context forever, level 12''';
end if;
end;
/With that in place I then did some environmental setup and executed the test:
C:\Projects\Test\Java\OCIResultCache>set ORACLE_HOME=C:\Oracle\instantclient_11_2
C:\Projects\Test\Java\OCIResultCache>set CLASSPATH=.;%ORACLE_HOME%\ojdbc6.jar
C:\Projects\Test\Java\OCIResultCache>set PATH=%ORACLE_HOME%\;%PATH%
C:\Projects\Test\Java\OCIResultCache>java OCIResultCache
Execution time [sql1] = 1654 ms.
Execution time [sql2] = 686 ms.
Enter to continue...This is all on my laptop, so results are not stellar in terms of performance; however, you can see that the portion of the test that uses the OCI client result cache did execute in approximately half of the time as the non-cached portion.
But, the more compelling data is in the resulting trace file which I ran through the tkprof utility to make it nicely formatted and summarized:
SQL ID: cqx6mdvs7mqud Plan Hash: 2228653197
select /*+ no_result_cache */ first_name, last_name
from
hr.employees
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 10000 0.10 0.10 0 0 0 0
Fetch 10001 0.49 0.54 0 10001 0 1070000
total 20002 0.60 0.65 0 10001 0 1070000
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 94
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
107 107 107 INDEX FULL SCAN EMP_NAME_IX (cr=2 pr=0 pw=0 time=21 us cost=1 size=1605 card=107)(object id 75241)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 10001 0.00 0.00
SQL*Net message from client 10001 0.00 1.10
SQL ID: frzmxy93n71ss Plan Hash: 2228653197
select /*+ result_cache */ first_name, last_name
from
hr.employees
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.01 0 11 22 0
Fetch 2 0.00 0.00 0 0 0 107
total 4 0.00 0.01 0 11 22 107
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 94
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
107 107 107 RESULT CACHE 0rdkpjr5p74cf0n0cs95ntguh7 (cr=0 pr=0 pw=0 time=12 us)
0 0 0 INDEX FULL SCAN EMP_NAME_IX (cr=0 pr=0 pw=0 time=0 us cost=1 size=1605 card=107)(object id 75241)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
log file sync 1 0.00 0.00
SQL*Net message from client 2 1.13 1.13The key differences here are the execute, fetch, and SQL*Net message values. Using the client-side cache, the values drop dramatically due to getting the results from client memory rather than round-trips to the server.
Of course, corrections, clarifications, etc. welcome and so on...
Regards,
Mark -
Hi all,
At the moment we have some java classes (not ejb - cmp/bmp) for search in
our ejb application.
Now we have a problem i.e. records have grown too high( millions ) and
sometimes query results in retrieval of millions of records. It results in
too much memory consumtion in our ejb application. What is the best way to
address this issue.
Any help will be highly appreciated.
Thanks & regards,
Parvezyou can think of following options
1) paging: read only few thousands at a time and maintain a index to page
through complete dataset
2) caching!
a) you can create a serialized data file in server to cache the result set
and can use that to browse through. you may do on the fly
compression/uncompression while sending data to client.
b) applet based solution where caching could be in client side. Look in
http://www.sitraka.com/software/jclass/cs_ims.html
thanks,
Srinivas
"chauhan" <[email protected]> wrote in message
news:[email protected]...
Thanks Slava Imeshev,
We already have search criteria and a limit. When records exceeds thatlimit
then we prompt user that it may take sometime, do you want to proceed? If
he clicks yes then we retrieve those records. This results in lot ofmemory
consumtion.
I was thinking if there is some way that from database I can retrieve some
block of records at a time rather the all records of a query. I wander how
internet search sites work, where thousnds of sites/pages match criteriaand
client can move back & front on any page.
Regards,
Parvez
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi chauhan,
You may want to narrow search criteria along with processing a
limited number of resulting records. I.e. if the size of the result
is bigger than a limit, you stop fetching results and notify the client
that search criteria should be narrowed.
HTH.
Regards,
Slava Imeshev
"chauhan" <[email protected]> wrote in message
news:[email protected]...
Hi all,
At the moment we have some java classes (not ejb - cmp/bmp) for
search
in
our ejb application.
Now we have a problem i.e. records have grown too high( millions ) and
sometimes query results in retrieval of millions of records. It
results
in
too much memory consumtion in our ejb application. What is the best
way
to
address this issue.
Any help will be highly appreciated.
Thanks & regards,
Parvez -
I'm using JDev 11.1.1.6 and when I type a value into an af:inputListOfValues component and hit either the enter key or the tab key it will replace the value I entered with the first item in the LOV result set. If enter a value and just click out of the af:inputListOfValues component it works correctly. If I use the popup and search for a value it works correctly as well. I have a programmatic view object which contains a single transient attribute (this is the view object which is used to create the list of value component from) and then I have another entity based view object which defines one of its attributes as a list of value attribute. I tried using an entity based view object to create the LOV from and everything works as expected so I'm not sure if this is a bug when using programmatic view objects or if I need more code in the VOImpl. Also, it seems that after the first time of the value being replaced by the first value in the result set that it will work correctly as well. Below are some of the important code snippets.
Also, it looks like it only doesn't work if the text entered in the af:inputListOfValues component would only have a single match returned in the result set. For instance given the result set in the code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy
If we enter Cha, the component works as expected
If we enter A, the component works as expected
If we enter Jimmy, the component does not work as expected and returns the first value of the result set ie. Brad
If we enter Fred, the component does not work as expected and returns the first value of the result set ie. Brad
I also verified that I get the same behavior in JDev 11.1.1.7
UsersVOImpl (Programmatic View Object with 1 transient attribute)
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import oracle.adf.share.logging.ADFLogger;
import oracle.jbo.JboException;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;
// --- File generated by Oracle ADF Business Components Design Time.
// --- Wed Sep 18 15:59:44 CDT 2013
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
public class UsersVOImpl extends ViewObjectImpl {
private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
private long hitCount = 0;
* This is the default constructor (do not remove).
public UsersVOImpl () {
* executeQueryForCollection - overridden for custom java data source support.
protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
List<String> usersList = new ArrayList<String>();
usersList.add("Brad");
usersList.add("Adam");
usersList.add("Aaron");
usersList.add("Fred");
usersList.add("Charles");
usersList.add("Charlie");
usersList.add("Jimmy");
Iterator usersIterator = usersList.iterator();
setUserDataForCollection(qc, usersIterator);
hitCount = usersList.size();
super.executeQueryForCollection(qc, params, noUserParams);
} // end executeQueryForCollection
* hasNextForCollection - overridden for custom java data source support.
protected boolean hasNextForCollection (Object qc) {
Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
if (usersListIterator.hasNext()) {
return true;
} else {
setFetchCompleteForCollection(qc, true);
return false;
} // end if
} // end hasNextForCollection
* createRowFromResultSet - overridden for custom java data source support.
protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
String user = (String)usersListIterator.next();
ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
try {
populateAttributeForRow(viewRowImpl, 0, user.toString());
} catch (Exception e) {
LOGGER.severe("Error Initializing Data", e);
throw new JboException(e);
} // end try/catch
return viewRowImpl;
} // end createRowFromResultSet
* getQueryHitCount - overridden for custom java data source support.
public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
return hitCount;
} // end getQueryHitCount
@Override
protected void create () {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
} // end create
@Override
protected void releaseUserDataForCollection (Object qc, Object rs) {
Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
usersListIterator = null;
super.releaseUserDataForCollection(qc, rs);
} // end releaseUserDataForCollection
} // end class
<af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
searchDesc="#{bindings.UserName.hints.tooltip}"
simple="true">
<f:validator binding="#{bindings.UserName.validator}"/>
</af:inputListOfValues>I have found a solution to this issue. It seems that when using a programmatic view object which has a transient attribute as its primary key you need to override more methods in the ViewObjectImpl so that it knows how to locate the row related to the primary key when the view object records aren't in the cache. This is why it would work correctly sometimes but not all the time. Below are the additional methods you need to override. The logic you use in retrieveByKey would be on a view object by view object basis and would be different if you had a primary key which consisted of more than one attribute.
@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
return retrieveByKey(viewRowSetImpl, null, key, i, false);
@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
RowSetIterator usersRowSetIterator = this.createRowSet(null);
Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
usersRowSetIterator.closeRowSetIterator();
return userRows;
@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
return retrieveByKey(viewRowSetImpl, null, key, i, b); -
Problem in creating Saved Result Set (SRS) in OBIEE 10.1.3.4
Hi,
We have migrated Siebel Analytincs 7.8.5 to OBIEE 10.1.3.4, and we are now unable to create any SRS from OBIEE though we can create Segment and marketing cache for the segment.
We did the following steps -
1. Unisntall Siebel Analytincs 7.8.5
2. Install OBIEE 10.1.3.4
3. Use MIGRATE tool (sawmigrate) to migrate RPD & WEBCAT
4. We have ALTERed the SRS tables - M_SR_HEADER, M_SR_ACCOUNT (as in OBIEE version there are many new columns have been added)
5. We passed GLOBAL CONSISTENCY in the RPD
6. We followed the steps in the document *"Oracle®Marketing Segmentation Guide Version 10.1.3.4 July 2008"*
7. We created a Saved Result Set Format as instructed in the document - here we are very confused to select the list of columns - we don't know what should be the excat source / format
8. Then we click the SRS create button
9. We got the below error -
Error Codes: QS2QOLYY:GDL67CY9:IHVF6OM7:OPR4ONWY:U9IM8TAC
Error in getting cursor for WorkNode (Id:0)
Authentication Failure.
Odbc driver returned an error (SQLDriverConnectW).
*State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused. [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)*
Can anyone help us to resolve the issue ?
A quick response is much much appreciated.
Many Thanks,
PrasantaHi,
It seems like you didnt setup the Administrator user for Saved Result Sets as it mentioned in the Marketing Segmentation Guide.
Here is an extract from the guide:
Setting Up the Web Administrator for Managing Cache and Saved Result Sets
Some queries issued by the segmentation engine require the use of the Execute Physical stored
procedure. These queries include delete statements on the cache, delete statements on the saved
result sets, and insert statements for the cache and saved result set. The Execute Physical stored
procedure must be run by a user with administrator privileges. The administrator user is set up in
the instanceconfig.xml file.
NOTE: The BI Administrator password and login parameters are case sensitive.
To set up the administrative user in the instanceconfig.xml file
1 Open a command shell and navigate to the <OracleBI>/web/bin, where <OracleBI> represents
the root directory of the installation.
2 Execute the following command:
cryptotools credstore -add -infile <OracleBIData>/web/config/credentialstore.xml
3 When prompted, enter the following values:
Credential Alias: admin
Username: Administrator
Password: <enter Admin password here>
Do you want to encrypt the password? y
Passphrase for encryption: <password >
Do you want to write the passphrase to the xml? n
File "<OracleBIData>/web/config/credentialstore.xml" exists. Do you want to overwrite it? y
4 Open the credentialstore.xml file and verify that the following section has been created:
<sawcs:credential type="usernamePassword" alias=“admin">
<sawcs:username> Administrator </sawcs:username>
<sawcs:password>
<xenc:EncryptedData> -
(1)In JSP front-end, I have the following code:
<%
ComUtil c = new ComUtil();
String sAppConfig = c.getAppConfigStr();
%>
<jbo:ApplicationModule id="am" configname="<%=sAppConfig%>" releasemode="Stateless" />
// A datatag is put here to print out a combo box for user selection with all places defined in table
<MyTagLib:PrintSelectForAllPlaces strTagName="v_CheckPlace" strAmId="am" blnDisplayHyphen="false" />
<jbo:ReleasePageResources />
(2) The ComUtil.getAppConfigStr() code is as follows:
// Configurations parameters
String _cfPkg = "MyPkg"; // Configuration package name
String am = cfPkg + ".MyAppMod"; // Fully-qualified application module name
String _cf = "MyPkgAppModLocal"; // Configuration name for connection info
String IP_ADDR = "xxx.xxx.xx.xxx"; // x stands for number
String SID = "MySid";
String PORT = "xxx"; // x stands for number
/** Connection string used by front-end JSP for Jbo to obtain configuration name for
an application module **/
public String getAppConfigStr () {
// Create an instance of the application module by name, using local mode
String sAppConfigStr = am + "." + cf;
return sAppConfigStr;
(3) My data tag code:
public class PrintSelectForAllPlaces extends TagSupport {
public int doStartTag() {
ViewMyPlacesRowImpl r = new ViewMyPlacesRowImpl();
ComUtil c = new ComUtil();
ApplicationModuleRef amRef = Utils.getAMRefFromContext(pageContext, strAmId);
ApplicationModule am = amRef.useApplicationModule();
JspWriter out = pageContext.getOut();
try {
ViewObject vo = am.findViewObject("ViewMyPlaces");
if (vo != null) {
vo.executeQuery();
int j = 0;
out.println("<select name=" + strTagName + " " + strActionList + ">");
if (blnDisplayHyphen) {
out.println("<option value = '' selected>--</option>");
while (vo.hasNext()) {
r = (ViewMyPlacesRowImpl)vo.next();
String sPlaceCode = (String)r.getPlaceCode();
String sPlaceDesc = (String)r.getDescription();
out.print("<option value = '" + sPlaceCode + "' ");
System.out.println("sPlaceCode: " + sPlaceCode);
if (strDefaultValue != null) {
if (strDefaultValue.length() > 0) {
if (sPlaceCode.equals(strDefaultValue)) {
out.print("selected");
out.print(">");
out.print(sPlaceDesc);
out.println("</option>");
out.println("</select>");
} else {
out.println("View object not found! ");
} catch (JboException je) {
je.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
return SKIP_BODY;
My question:
- When i run my jsp, sometimes 2 rows are retrieved, sometimes 3 row are retrieved, sometimes all are retrieved, which can be simulated by 'Refreshing' the jsp page. I feel quite upset as this affects my whole application seriously. Would anyone give me any idea about my case?
(I have tried to re-make and re-compile the project; synchronizing my table structure; and also tried vo.clearCache(); but still no use. Moreover, The retrieved resultset supposed to be a reference table which will not change frequently, which means that caching is not serious affected.)
My case is quite urgent to me. In case of any ideas, please don't hesitate to let me know.
Thanks a lot for your replies!Dear Shailesh, would you please give me some guidelines for how to generate diagnostic outputs for BC4J? I don't know how to run the function, which may be very helpful for debugging. ^v^
Regarding the problem I mentioned, more details are listed as follows:
1. My mentioned table has 5 rows in total.
2. My expected result set has 4 rows, which is filtered by the Query statement:
- SELECT PLACE_CODE, PLACE_DESC FROM PLACES WHERE DISPLAY_FLAG = 'Y';
3. Why I know the retrieved row is not equal because the program code line in my first post for this topic:
System.out.println("sPlaceCode: " + sPlaceCode) is embedded in the loop within while (rs.hasNext()). Sometimes the output like this:
sPlaceCode: PLACE1
sPlaceCode: PLACE2
sPlaceCode: PLACE3
Sometimes like this:
sPlaceCode: PLACE1
sPlaceCode: PLACE2
4. It is in random behavior.
The situation has been improved after I have 'Test' the BC4J view, that I have navigated all records. Then, the time of displayed all expected records has been increased. Such a mystery ... What I am feeling worried is that, I can't navigate all the time for my reference tables ~~~ besides, it still shows the same problem until now.
My Requests:
1. Please give me the guidelines for generating the diagnostic output.
2. Please help to investigate my mentioned problem.
Thanks so much for your help and replies! -
How to use stored procedure which returns result set in OBIEE
Hi,
I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
Pls help me in solving this.
ThanksHi Radha,
If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
If you want to use caching, you should enable caching in the nqsconfig.ini file.
Cheers,
Daan Bakboord -
I am working with BO XI R3 and back end as DB2.
I am facing a partial LOV results set:
From my analysis I have the following:
1)This error occurs with a particular table
2)The number of rows that are being fetched from the database are 44,018,911 rows (nearly 44 million) out of which 178,940 rows are unique ones
3)These rows are not cached/stored daily. Hence each and everytime the report is run it has to fetch from the DB and bring it to the report.
4)On the Universe front, checked with the Universe File-->Parameters tab and "Limit size and time" are unchecked
5)On the report front there is no limiter for the number of rows.
I am not sure but where the tuning has to be done? At the DB front (DB2 is my back end) or on the Universe front (BO XIR3). 1 ) Which would better 2) In case the tuning has to be done on the Universe front how does it need to be done?Are you getting this one on the Webi report Lovis or Deski Report
If its a webi report you need to change in the Webintelligence Processing server Properties.
The Default vales fro the Maximum List of values size entries is 50000 Lovs -
Statement.close() Not closing the Result set
Hi all,
I have the following code which invokes a procedure in Oracle database
public static callProcedure(Connection connection,String procedure){
ResultSet resultSet = null;
CallableStatement callableStatement = null;
try {
callableStatement = connection.prepareCall(procedure);
callableStatement.registerOutParameter(1,OracleTypes.CURSOR);
callableStatement.execute();
resultSet =((OracleCallableStatement)callableStatement).getCursor(1);
} catch (Exception exception) {
exception.printStackTrace();
} finally {
try {
callableStatement.close();
} catch (SQLException sqlException) {
sqlException.printStackTrace()
return resultSet;
Ideally if i try to iterate through the result set which is returned then it should give me resultset closed as i am closing the resultset. But this is not happening.
Please anybody can explain the isueHi,
That is not easy to explain, I might take a guess and say that a statement cache is being used therefore the statement is not actually being closed.
I always close the reultset then the statement so wouldn't notice this behaviour.
Why are you returning a resultset anyway? If you really need to do this I would suggest using a disconnected resultset:
OracleCachedRowSet ocrs = new OracleCachedRowSet();
ocrs.populate(resultSet);
return ocrs; -
Stored function not returning result set unless recompiled
Hi,
I have a strange situation going on with a basic Java (1.6.0.17) application talking to an Oracle 11g (11.2.0.1.0) database. Basically what is happening is that sometimes a stored function's return value (a result set) is not making it as far as JDBC/Java, unless I recompile the stored function (with absolutely no changes to the application or function's code). I am always able to successfully see the result set if I call the function directly from within SQL Developer, just not on the Java app/JDBC side.
I've tried running with 3 different physical Oracle 11g servers and tried running the app on a couple of machines. I'm wondering if this is either some kind of caching issue or perhaps a JDBC bug/misconfiguration.
Any help would be greatly appreciated. Attached to this message:
1. stored function code
2. snippet of Java app code
3. ODBC trace output when returned a empty result set (ie failure scenario)
4. ODBC trace out when returned the correct result set (ie success scenario)
* it's helpful if you compare the texts of 3 & 4 with Vim diff or WinMerge etc.
** as they're large I've just extracted the sections that had differences. Leave a message here and I can send you the full ones if necessary.
1. stored function code
===============
FUNCTION getRecordSet (
ActionId Number
RETURN CallingList.ref_cursor
IS
myDataCursor CallingList.ref_cursor;
ActionId_ Number;
BEGIN
ActionId_ := ActionId;
IF isActionExpired(ActionId) <= 0 THEN
ActionId_ := 0;
END IF;
OPEN myDataCursor FOR
SELECT
C.ID,
C.CUSTOMER_ID,
C.CAMPAIGN_ID,
c.phone,
C.TRANSFERDN,
(SELECT
TTS_MESSAGE
FROM CAMPAIGN CMP
WHERE CMP.CAMPAIGN_ID = C.CAMPAIGN_ID) "TTS"
FROM
CALLING_LIST C
WHERE
C.ACTION_ID = ActionId_
AND
C.CALL_STATUS = 1
AND
C.CALLCOUNT > 0
And rownum <=5;
RETURN myDataCursor;
EXCEPTION
WHEN CURSOR_ALREADY_OPEN THEN
RETURN NULL;
WHEN INVALID_CURSOR THEN
RETURN NULL;
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END getRecordSet;
....and the isActionExpired function that is called from within getResultSet is (but for all my testing it's been returning 1 with no problems)
FUNCTION isActionExpired (
ActionId number
) RETURN number
AS
Today varchar2(12);
myCount number(6);
BEGIN
myCount := 0;
today := to_char(sysdate, 'dd.mm.yyyy');
SELECT
count(*)
INTO
myCount
FROM
ACTION A
where
ACTION_ID = ActionId
AND
SYSDATE BETWEEN ACTION_STARTDATETIME
AND
ACTION_STOPDATETIME
and
SYSDATE BETWEEN to_date(today || ' ' || A.STARTTIME, 'dd.mm.yyyy HH24:MI:SS') and to_date(today || ' ' || A.ENDTIME, 'dd.mm.yyyy HH24:MI:SS')
AND
ACTION_STATUS = 1;
return myCount;
END isActionExpired;
2. snippet of Java app code
=================
... db connect logic...
javax.management.MBeanServer mbs = null;
javax.management.ObjectName name = null;
try {
String loader = Thread.currentThread().getContextClassLoader().toString().replaceAll("[,=:\"]+", "");
name = new javax.management.ObjectName("com.oracle.jdbc:type=diagnosability,name="+loader);
mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer();
mbs.setAttribute(name, new javax.management.Attribute("LoggingEnabled", true));
} catch (Exception e) {
System.out.println("ORACLE TRACE ERROR: " + e.getStackTrace());
try {
String query = "begin ? := CALLINGLIST.getRecordSet(?); end;";
CallableStatement stmt = conn.prepareCall(query);
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.setInt(2, actionId);
stmt.execute();
ResultSet rs = (ResultSet) stmt.getObject(1); // So, here it works.
// print the results
int count=0;
while (rs.next()) {
count++;
stmt.close();
System.out.println("rs count was: " + count);
} catch (SQLException e) {
System.out.println("Exception occurred: " + e.getMessage());
3. ODBC trace output when returned a empty result set (ie failure scenario)
===============================================
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=121, flags=0
00 79 00 00 06 00 00 00 |.y......|
00 00 06 22 01 06 00 01 |..."....|
0A 00 00 00 07 03 C2 04 |........|
0E 04 C3 5E 22 03 02 C1 |...^"...|
2A 04 33 30 30 32 03 37 |*.3002.7|
37 37 05 48 65 6C 6C 6F |77.Hello|
08 01 06 00 00 01 02 00 |........|
00 00 00 00 00 04 01 05 |........|
01 01 02 05 7B 00 00 01 |....{...|
02 00 03 00 00 00 00 00 |........|
00 00 00 00 00 00 00 00 |........|
00 01 01 00 00 00 00 19 |........|
4F 52 41 2D 30 31 34 30 |ORA-0140|
33 3A 20 6E 6F 20 64 61 |3:.no.da|
74 61 20 66 6F 75 6E 64 |ta.found|
0A |. |
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, 20
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, 871, [I@1315d34, 20, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, true, 20
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, 10
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, 871, [I@1de256f, 10, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, true, 10
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, 2000
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, 871, [I@16bd8ea, 2000, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, true, 2000
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@16e1fb1
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=0, statement.totalRowsVisited=1, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: return:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OraclePreparedStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement close
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
TRACE_16: Enter: null
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
4. ODBC trace out when returned the correct result set (ie success scenario)
===============================================
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=82, flags=0
00 52 00 00 06 00 00 00 |.R......|
00 00 08 01 06 00 00 01 |........|
02 00 00 00 00 00 00 04 |........|
01 05 00 02 05 7B 00 00 |.....{..|
01 02 00 03 00 00 00 00 |........|
00 00 00 00 00 00 00 00 |........|
00 00 01 01 00 00 00 00 |........|
19 4F 52 41 2D 30 31 34 |.ORA-014|
30 33 3A 20 6E 6F 20 64 |03:.no.d|
61 74 61 20 66 6F 75 6E |ata.foun|
64 0A |d. |
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@1fa1bb6
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=true, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=0, statement.gotLastBatch=false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
Edited by: user9376621 on Jul 1, 2010 1:07 AM
Edited by: user9376621 on Jul 1, 2010 1:13 AMPlease ignore this, it was a non-issue in the end.
-
Can we pass temporary result set to the procedure?
Hi,
The result set is stored in a temporary storage. Can we pass that resultset to the procedure?
Thanks and regards
Gowtham Sen.I'm still unclear just what this result set is... Is is a table or a cursor or something else?
If you imply the physical result set of a SQL query, there is no such thing in Oracle. Oracle does not create and store a result set in memory containing the rows of the SQL SELECT. Creating such sets in memory does not scale. A single SELECT on such a database can kill the performance of the entire database by exhasuting all memory with a single large physical result set.
Oracle "results" live in the database cache (residing in the SGA). Rows (as data blocks) are paged into and out of this case as demand dictates. When PL/SQL code, for example, fetches a row, the SQL engine grabs the row from the db cache (SGA) and copies it to the PGA (the private memory area of the PL/SQL process). The row also may not yet exist in the db cache - in which case it needs a physical read from disk to get the data block containing that row into the db cache (after which it is copied to the PGA).
A PL/SQL process can do a bulk fetch - e.g. fetch a 100 rows from the SQL query/cursor at a time. In that case, a 100 rows are copied from the SGA db cache to the PGA.
At no time is there are single large unique and dedicated memory struct in the SGA that contains the complete "result set" of a SQL query.
Once you have fetched that row, that is it. Deal is done. You cannot reverse the cursor and fetch the row again. After you have fetched the last row in that cursor, you cannot pass that cursor to another process - the cursor is now empty. That other process cannot rewind the cursor and start fetching from the 1st row again. You will need to pass the SQL to that process in order for it to create its own cursor - also keeping in mind that in between the rows can have changed and that this other process could now see different results with its cursor.
If you want to create such a physical temporary result set that is consistent and re-usable, you can use a temporary table - and insert the results of the SELECT into this temp table for further processing. This temp table is session specific and is auto destroyed when the session terminates.
A comment though - it sounds like you're approaching the date warehouse processing (scrubbing, transformation and loading of data) as a row-by-row process.
That is a flawed approach. Row-by-row processing does not scale. One should deal with data sets. Especially when the volumes are large. One should also attempt to perform minimal passes through a data set. Processing a bunch of rows, then passing that rows to another process to do some processing on the same rows.. this means multiple passes through the same data. That is very inefficient performance and resource wise. -
How to display result set boolean value as a check box
Hi guys,
I am getting the data which include boolean from the database, i need to display the boolean values as check box, see my code, its displaying the data into the table with the boolean values as true and false, how to make it in check boxes
package swing2.org;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import javax.swing.table.AbstractTableModel;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.ComponentOrientation;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
public class Panel2 extends JPanel {
private static final long serialVersionUID = 1L;
private JScrollPane jScrollPane = null;
private JTable jTable = null;
* This is the default constructor
public Panel2() {
super();
initialize();
* This method initializes this
* @return void
private void initialize() {
// Panel2.ResultSetFrame();
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = GridBagConstraints.BOTH;
gridBagConstraints.gridy = 0;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.gridx = 0;
this.setSize(340, 200);
this.setLayout(new GridBagLayout());
this.setBackground(new Color(171, 211, 224));
this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED), null));
this.add(getJScrollPane(), gridBagConstraints);
* This method initializes jScrollPane
* @return javax.swing.JScrollPane
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getJTable());
return jScrollPane;
String[] columnNames = {"Task Description",
"Time ",
"Pop-up",
"Sound",
"Delete"};
* This method initializes jTable
* @return javax.swing.JTable
private JTable getJTable() {
ResultSetFrame oo = new ResultSetFrame();
JTable table = new JTable(oo.model);
table.setBackground(new Color(195, 217, 230));
table.setComponentOrientation(ComponentOrientation.UNKNOWN);
table.setShowGrid(true);
table.setShowVerticalLines(true);
table.setRowHeight(17);
table.setShowHorizontalLines(true);
return table;
abstract class ResultSetTableModel extends AbstractTableModel
public ResultSetTableModel(ResultSet aResultSet)
rs = aResultSet;
try
rsmd = rs.getMetaData();
catch(SQLException e)
System.out.println("Error " + e);
public String getColumnName(int c)
{ try
{ return rsmd.getColumnName(c + 1);
catch(SQLException e)
{ System.out.println("Error " + e);
return "";
public int getColumnCount()
{ try
{ return rsmd.getColumnCount();
catch(SQLException e)
{ System.out.println("Error " + e);
return 0;
protected ResultSet getResultSet()
{ return rs;
private ResultSet rs;
private ResultSetMetaData rsmd;
class CachingResultSetTableModel extends ResultSetTableModel
{ public CachingResultSetTableModel(ResultSet aResultSet)
{ super(aResultSet);
try
{ cache = new ArrayList();
int cols = getColumnCount();
ResultSet rs = getResultSet();
/* place all data in an array list of Object[] arrays
We don't use an Object[][] because we don't know
how many rows are in the result set
while (rs.next())
{ Object[] row = new Object[cols];
for (int j = 0; j < row.length; j++)
row[j] = rs.getObject(j + 1);
cache.add(row);
catch(SQLException e)
{ System.out.println("Error " + e);
public Object getValueAt(int r, int c)
{ if (r < cache.size())
return ((Object[])cache.get(r))[c];
else
return null;
public int getRowCount()
{ return cache.size();
private ArrayList cache;
class ResultSetFrame
{ public ResultSetFrame()
/* find all tables in the database and add them to
a combo box
try
{ Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/task","root","nbuser");
stmt = con.prepareStatement("SELECT * FROM tasky");
try
String query = "SELECT * FROM tasky";
rs = stmt.executeQuery(query);
model = new CachingResultSetTableModel(rs);
JTable table = new JTable(model);
scrollPane = new JScrollPane(table);
catch(SQLException e)
System.out.println("Error " + e);
catch(ClassNotFoundException e)
{ System.out.println("Error " + e);
catch(SQLException e)
{ System.out.println("Error " + e);
private JScrollPane scrollPane;
public ResultSetTableModel model;
private ResultSet rs;
private Connection con;
private Statement stmt;
}add a
public Class getColumnClass(int col) {
return getValueAt(0, col).getClass();
}in your ResultSetTableModel which extends AbstractTableModel.
A simple example
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
public class SimpleDemo extends JFrame {
public SimpleDemo() {
createAndShowUI();
private void createAndShowUI(){
String[] columnName = {"CheckBox Column", "Data Column"};
Object[][] data = {{new Boolean(true), "Data 1"},
{new Boolean(false), "Data 2"}, {new Boolean(true), "Data 3"}};
MyModel model = new MyModel();
model.setData(columnName, data);
JTable myTable = new JTable(model);
JScrollPane scrollPane = new JScrollPane(myTable);
setDefaultCloseOperation(EXIT_ON_CLOSE);
getContentPane().add(scrollPane);
pack();
setLocationRelativeTo(null);
class MyModel extends AbstractTableModel {
String[] columnName;
Object[][] data;
public void setData(String[] colName, Object[][] theData) {
this.columnName = colName;
this.data = theData;
fireTableStructureChanged();
public String getColumnName(int column) {
return columnName[column];
public Object getValueAt(int rowIndex, int columnIndex) {
return data[rowIndex][columnIndex];
public int getRowCount() {
return data.length;
public int getColumnCount() {
return columnName.length;
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public static void main(String[] args){
Runnable run = new Runnable(){
public void run(){
new SimpleDemo().setVisible(true);
SwingUtilities.invokeLater(run);
}
Maybe you are looking for
-
How do I set up a user account on a Macbook Air
I am trying to help an elderly neighbor whose son gave her his Macbook Air to use but he is the Administrator and has been recently deployed overseas and she cannot contact him. How can I set her up with her own account on his computer without his Ad
-
Conecting 2wire AT&T modem to Linksys Router
Please help. International tech support has hung up me 3 times. I am looking up a simple Linksys WRT110 Router to an SBC/AT&T 2wire modem. The modem is hooked up to the wall using a coaxial TV cable. Thus, I assume that this is a cable modem. Wh
-
I am new to BIP. We have a scheduled report that bursts different pdfs every week on friday. These pdfs are bursted to an ECM folder through WebDAV.This folder is static. But I have to burst the pdfs to a different new folder everyweek. Is there a wa
-
If i need 2 send an Object that allready exist like Image .....
Hi Folks , i need an Advise to my problems. My problems is like that I need 2 send an Object a lot of times throw the Soket for this i need packing my Objects and send them 1 after 1 i will try say more clearly i need 2 send a lot of Frames (Image Ca
-
Elements 10 won't allow actions
Elements 10 won't allow actions (copy background ect..) on my new computer with correct activation key.