Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with detailcriteria in 9i

 
Dany Thivierge
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!
We used to have this code running fine in 8i in a JSP file:
objViewObject = objAppModule.findViewObject("menu_view");
objViewObject.setWhereClause("Utilisateur.ID_UTILISATEUR = ?");
objViewObject.setWhereClauseParam(0, strIdUtilisateur);
<jsp:useBean id="XSLTProcesseur" class="drioq.XmlExt.XmlDataExt" scope="request">
<%
XSLTProcesseur.initialize(application, session , request, response, out, "infogen_InfoGen_app.menu_view");
XSLTProcesseur.initialize(pageContext,"infogen_InfoGen_app.menu_view");
XSLTProcesseur.setReleaseApplicationResources(true);
XSLTProcesseur.setStylesheet("/xsl/my.xsl");
XSLTProcesseur.render();
%>
</jsp:useBean>
-------------------------------------------
That was running fine (returning the view menu_view with the query change to the one we set in the "setWhereClause". But now that we run this on 9i it dosent run well... Now it run the menu_view without the "setWhereClause" so it return all the row and not only those that we want.
Did anyone seen this kind of problem?
Thank for the help guys.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before it actually runs the query, have you done a System.out.println to see the query it is going to run? does it have the where clause in it.
I am thinking it doesn't happen because of Oracle, but is in the class code.
Mark
 
Dany Thivierge
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark for the repply,
Yes i've check the query and it dosent contain the where clause... lok like the XSLTProcesseur.initialize(application, session , request, response, out, "infogen_InfoGen_app.menu_view");
dosent use the things set in the objViewObject.setWhereClause("...") It was working fine before we migrate to 9i... look at what i've found in the class XmlDataEXT:
/* Slightly changed version of XmlData , in order to support customization
* of detail views while rendering.
* The change consist in changing the type of the xrr attribute from
* XmlRowSetRenderer to XmlRowSetRendererExt , also a custom class that
* looks for a criteria on the session context.
* The value name should be of the form
* <view_name>_DetailCriteria
* Example: myViewName_DetailCriteria
* The clause should not contain bind variables. ( The overcrowding of the
* pool might be prevented by using the CURSOR_SHARING=FORCE setting in the
* init.ora file)
* A second change consists in adding a call to the setSession method of
* the mentioned xrr attribute, in the body internalInitialize method
* ALSO, pay attention that the JSP application needs to be STATE-LESS in order
* for the where clause on the the master query, ( dealt with by the DataWebBeanImpl
* class) to work
*/
I dont quite understand what it is but we are using a custum class (made by Oracle back in 1999). And now it seem not to use the same "magic" to run...
Any help will be appreciate!
Thanks again!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the best I could help you with is regarding using Java to construct a query and run it and get results back.
I am currently working on a simple Servlet that the user enters Project Number and region, selects HTML or PDF, then clicks a button.
The servlet takes the parameters, makes the query (with where clause based on parameters), runs the query against Oracle, translates the resultSet to XML, then with an XSL document transform it into HTML, and with a different XSL:FO document transform then have FOP return PDF to the Browser.
Here's my Java code for Oracle.


now the getSQL and getData are called by a seperate method as in

This uses a helper class to take the ResultSet and translate it into XML.
Hope this can help you. It looks like you need to rewrite those classes that uses the object that was "Magic" before. Hopefully things weren't too coupled together. If it is look at it as an opportunity to de-couple and refactor so you never find yourself in the same position.
Good Luck
Mark
 
Dany Thivierge
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again Mark!
But as we are migrating an old applicatin (in 8i) it is not an option to redo all our JSP. We need to use the BC4J view object and application.initialise and rendre to ouput our XML-XSl. We plan to redo all the product in OC4J but later...
we are still open to get some help!
see ya
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really feel like hijacking this thread into "top 10 ways to optimize Mark's code".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic