[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Am I closing Everything In Transformation?

Subject: Am I closing Everything In Transformation?
From: "Scott Purcell" <spurcell@xxxxxxxxxxxxx>
Date: Fri, 23 Aug 2002 10:07:48 -0500
transform.setparameter
Hello,
I have the following code, that is in a servlet that runs on box A. There is a web-site that does a JSP include on box B, that includes my servlet from box A. We are using the automounter for the nfs mount. All works well, but I am having a problem with something staying open on box B. I am wondering if there is something in the transformation that should be closed to release the connection?

Here is the code, showing the whole transformation, and I bet something should be closed that is not. Has anyone dealt with this before?

Thanks,
Scott


        try {
            javax.xml.transform.Source xmlSource = new javax.xml.transform.stream.StreamSource(job.getXmlFile());
            javax.xml.transform.Source xsltSource = new javax.xml.transform.stream.StreamSource(job.getXslFile());
            javax.xml.transform.Result result = new javax.xml.transform.stream.StreamResult(baos);
            javax.xml.transform.TransformerFactory transFact = javax.xml.transform.TransformerFactory.newInstance();
            javax.xml.transform.Transformer trans = transFact.newTransformer(xsltSource);


            /* ADD USER DEFINED INFO */
            Hashtable prefs = (Hashtable)job.getColorPrefs();
            Enumeration enum = prefs.keys();
            while (enum.hasMoreElements())
            {
                String tkey = (String)enum.nextElement();
                String tval = (String)prefs.get(tkey);
                trans.setParameter(tkey, tval);
            }

            // now set path stuff.
            trans.setParameter("userimage", job.getUserDrawerRelative() + "Pv/");
            trans.setParameter("systemimage", job.getSystemDrawerRelative() + "Pv/");

            //            trans.setParameter("userimage", job.getUserDrawerRelative());
            //trans.setParameter("systemimage", job.getSystemDrawerRelative());



            trans.setParameter("jobname", job.getJobName());
            trans.setParameter("url", job.getURL());
            trans.setParameter("user", job.getUserId());
            trans.setParameter("mxml", job.getJobName() + ".mxml");
            trans.setParameter("jpegImage", jpegImage);
            trans.setParameter("rhtmlImage", rhtmlImage);
            trans.setParameter("defaultImage", common + "/selectImage.jpg");
            trans.setParameter("apdf_url", apdf_url + "?itemid=" + job.getItemId() + "&userid=" + job.getUserId() + "&prodid=" + job.getProdId());
            trans.setParameter("merchant_url", merchant_url + "?prodID=" + job.getProdId() + "&itemID=" + job.getItemId());
            trans.transform(xmlSource, result);
        } catch (javax.xml.transform.TransformerException te) {
            System.out.println(te.getMessage() + " is error message.\n");
            tmp2.append(te.getMessage());
        }
        tmp2 = tmp2.append(baos.toString());
        try {
            baos.close();
        } catch (Exception e) {
            e.printStackTrace(System.out);
        }

Scott Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
T 314.588.0720 | F 314.588.0735 | spurcell@xxxxxxxxxxxxx | http://www.vertisinc.com

Vertis is a global powerhouse for integrated marketing and advertising solutions that seamlessly combine advertising, direct marketing, media, imaging and progressive technology. Vertis' products and services include: consumer and media research, media planning and placement, creative services, digital media production, targetable insert programs, fully integrated direct marketing programs, circulation-building newspaper products and eMarketing.




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.