Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

Hi, can anyone advise as to whether my tag library code (based
on Apache Jakarta Project) will actually achieve connection
pooling functionality across my entire JSP based application? I
am slightly concerned that my OracleConnectionCacheImpl object
may exist multiple times, hence rendering my conection pooling
attempt useless.
package com.solved.tag.dbtags.connection;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.JspTagException;
import javax.sql.DataSource;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import oracle.jdbc.pool.OracleConnectionCacheImpl;
* <p>JSP tag connection, used to get a
* java.sql.Connection object.</p>
* <p>JSP Tag Lib Descriptor
* <pre>
* &lt;name>connection&lt;/name>
&lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
agclass>
* &lt;bodycontent>JSP&lt;/bodycontent>
&lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
eiclass>
* &lt;info>Opens a connection based on a jndiName.&lt;/info>
* &lt;attribute>
* &lt;name>id&lt;/name>
* &lt;required>true&lt;/required>
* &lt;rtexprvalue>false&lt;/rtexprvalue>
* &lt;/attribute>
* </pre>
* @author Matt Shannon
public class ConnectionTag extends TagSupport {
static private OracleConnectionCacheImpl cache = null;
public int doStartTag() throws JspTagException {
try {
Connection conn = null;
if (cache == null) {
try {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup
("jdbc/pool/OracleCache");
cache = (OracleConnectionCacheImpl)ds;
catch (NamingException ne) {
throw new JspTagException(ne.toString());
conn = cache.getConnection();
pageContext.setAttribute(getId(),conn);
catch (SQLException e) {
throw new JspTagException(e.toString());
return EVAL_BODY_INCLUDE;
package com.solved.tag.dbtags.connection;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.jsp.tagext.TagSupport;
* <p>JSP tag closeconnection, used to close the
* specified java.sql.Connection.<p>
* <p>JSP Tag Lib Descriptor
* <pre>
* &lt;name>closeConnection&lt;/name>
&lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
lt;/tagclass>
* &lt;bodycontent>empty&lt;/bodycontent>
* &lt;info>Close the specified connection. The "conn"
attribute is the name of a
* connection object in the page context.&lt;/info>
* &lt;attribute>
* &lt;name>conn&lt;/name>
* &lt;required>true&lt;/required>
* &lt;rtexprvalue>false&lt;/rtexprvalue>
* &lt;/attribute>
* </pre>
* @author Matt Shannon
* @see ConnectionTag
public class CloseConnectionTag extends TagSupport {
private String _connId = null;
* The "conn" attribute is the name of a
* page context object containing a
* java.sql.Connection.
* @param connectionId
* attribute name of the java.sql.Connection to
close.
* @see ConnectionTag
public void setConn(String connectionId) {
_connId = connectionId;
public int doStartTag() {
try {
Connection conn = (Connection)pageContext.getAttribute
(_connId);
conn.close();
} catch (SQLException e) {
// failing to close a connection is not fatal
e.printStackTrace();
return EVAL_BODY_INCLUDE;
public void release() {
_connId = null;
package com.solved.tag.dbtags.connection;
import javax.servlet.jsp.tagext.TagData;
import javax.servlet.jsp.tagext.TagExtraInfo;
import javax.servlet.jsp.tagext.VariableInfo;
* TagExtraInfo for the connection tag. This
* TagExtraInfo specifies that the ConnectionTag
* assigns a java.sql.Connection object to the
* "id" attribute at the end tag.
* @author Matt Shannon
* @see ConnectionTag
public class ConnectionTEI extends TagExtraInfo {
public final VariableInfo[] getVariableInfo(TagData data)
return new VariableInfo[]
new VariableInfo(
data.getAttributeString("id"),
"java.sql.Connection",
true,
VariableInfo.AT_END
data-sources.xml:
<?xml version="1.0"?>
<!DOCTYPE data-sources PUBLIC "Orion data-
sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
<data-sources>
<data-source
class="oracle.jdbc.pool.OracleConnectionCacheImpl"
name="jdbc/pool/OracleCache"
location="jdbc/pool/OracleCache"
url="jdbc:oracle:thin:@oracle1:1521:pdev"
>
<property name="maxLimit" value="15" />
<property name="cacheScheme" value="2" />
<property name="user" value="console" />
<property name="password" value="console" />
<description>
This DataSource is using an Oracle-native DataSource Class so as
to allow Oracle Specific extensions.
A getConnection() call on this DataSource will return
oracle.jdbc.driver.OracleConnection.
The connection returned is a logical connection.
The caching scheme in place is Fixed Wait. Refer below to
possible values.
Dynamic 1
Fixed Wait 2
Fixed Return Null 3
</description>
</data-source>
</data-sources>
many thanks,
Matt.

Hi. Show me your pool definition.
Joe
Ramamurthy wrote:
I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
"javax.servlet.jsp.JspException: Failed to write body content
at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
After this message, whenever I try to access the same jsp page I am getting the message
"javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
river
at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
Can you please help me the reason why this problem is happening and how to fix this ?
This problem doexn't happen consistently. This occurs once in a while.
I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
Thanks for your help !!!
Ram

Similar Messages

  • I've been using a flip video camera since 2009 and all of my videos are in the flipshare library.  What is the best way to burn all these videos to a DVD that will play on my DVD player/tv?

    I've been using a flip video camera since 2009 and all of my videos are in the flipshare library.  What is the best way to burn all these videos to a DVD that will play on my DVD player/tv?  The flipshare library is taking up too much space on my Macbook and I wanted to delete these videos once they were all tranferred to DVDs.
    Any help is greatly appreciated.

    Purplehiddledog wrote:
    I do backup with iCloud.  I can't wait until the new iMac is available so that I can once again have my files in more than 1 location without needing to rely solely on the cloud. 
    I also rely on iTunes and my MacBook and Time Machine as well as backing up to iCloud. I know many users know have gone totally PC free, but I chose to use iCloud merely as my third backup.
    I assume that the restore would result in my ability to open Pages and Numbers and fix the problem with deleting apps, but this would also mean that if my Numbers documents still exist solely within the app and are just not on iCloud for some reason that they would be gone forever.  Is that right?
    In a word, yes. In a little more detail.... When you restore from an iCloud backup, you must erase the device and start all over again. There is no other way to access the backup in iCloud without erasing the device. Consequently, you are starting all over again. Therefore, it would also be my assumption that Pages and Numbers will work again and that the deleting apps issues would be fixed as well.
    If the documents are not in the backup, and you do not have a backup elsewhere, the documents could be gone forever.

  • My Iphoto libary is full and will not acept new photos, what is the best way to solve this problem without losing old photos

    Hi
    My Iphoto libary is full and wil not acept new photos what is the best way to solve this problem without losing the old photos?

    Here is a relevant discussion to your situation:
    https://discussions.apple.com/thread/2640787?start=0&tstart=0

  • When I send a webpage via email, some of my recipients are unable to see it properly. The website was made with iWeb, and a Mac person advised me this was the best way to do an email campaign with iWeb, but it's not working for a lot of my customers - why

    I have recently created a website for my family's business. When we bought the Macbook the guy in Apple said the best way to send an email campaign to our mailing list was to publish a hidden page, find it in the browser on Safari, then share it via email, so that is what I do. For most of my customers this works fine, however I have a number of people each month who cannot see any of the content of the email. I have added an 'If you can't see this email properly...' link at the top of the page, with no shapes or images etc near it, but even that does not appear for them.
    I am a self-taught novice unfortunately, so haven't a clue what the problem is. I'm not sure of the operating system, but we bought the Macbook in May and it has all the recent updates installed. I have just had a new baby so can't get into the store fdor a one-to-one, so if anyone could explain why this happens / what I can do about it, I would be very grateful! Thanks!

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • I Need to build a database/booking and dispatch system that intergrates with iCal, Address Book and all Apple device's What would be the best Way.

    Hi
    Can anyone give me some useful information on the best ways to design and build a database/booking & dispatch system that can be intergrated through ical, address book and available on my macbook, ipad & iphone and all accessed through icloud.
    I started my own chauffuer Service a year ago as an independent. it's becoming a massive bore that most of my time is spent taking down information, checking if i am available for clients and with alot of diary checking and repeatative entries and email ping pong and invoicing, what i want to do is concerntrate on advertising and marketing and using my time off for R & R
    What i would like to do is access my information in an app and automate most of the processes like
    assigning the job to the client with intergration through iCal and Address Book
    be able to email confirmation through mail with an invoice produced through numbers or excel
    payment is already done through payleven mobile and must be done in person so i'd rather keep that seperate to all processes apart from a tick box to say it has been paid for.
    I have been looking at all options  FileMaker, Bento, Automator, Apple Script. to be frank im no expert and am a little confused as to what to do any advice would be greatly recieved.

    Hi,
    I would suggest that is going to be an involved and complex process.
    I would personally look into some of the invoicing and time scheduling software available and see if any fit your needs.
    Take a look here: http://www.tuaw.com/2008/07/30/app-roundup-timekeeping-and-billing/
    and here: http://www.tuaw.com/2008/07/31/app-roundup-timekeeping-and-billing-part-ii-the-q uickening/
    for starters.
    Best wishes
    John M

  • I have a 1 Terrabyte HD and need to free up space, what is the best way to do so

    I want to free up space, what is the best way to do so without compromising speed and efficiencies?

    Put large files you do not use often on the external.  Movies.  I only watch a particular movies once every few years so I can keep them all on an external drive and just move them to my internal (for fast access) when I actually want to watch them.
    Make sure you buy a second external drive.  When your nice new 1TB drive develops a fault all your files on it will be lost.

  • New MacBook Pro (first Mac). I need to move my itunes library from my pc to a networked external hd (wd passport for mac). I have an ipod with all my media (including video) and i have itunes match. What is the best way to do this? PC to Mac HD ...

    Can I just consolidate and copy to the journaled hard drive over the network?  Will a pc recognize a Mac formatted hard drive?  I have searchd the forum and online for hours and can't seem to find anything that specifically address this.  Does anyone know the best solution?
    Itunes library on PC -> WD Passport for Mac (connected via airport extreme to new MacBook Pro).  I plan to use this as the default location for my library because the new Pro only has 256 GB onboard.
    Any help is greatly appreciated.

    A PC cannot read a Mac formatted drive without using special software (MacDrive).
    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Macworld - How to transfer iTunes libraries between PC and Mac - http://www.macworld.com/article/46248/2005/08/shiftitunes.html
    Move an iTunes library from a Windows PC to a Mac - http://www.macworld.com/article/1146958/move_itunes_windows_mac.html

  • Custom task (uc_task_custom)? how is the best way to implement intention

    Hello all,
    i would like to tell you our intention. We want to calculate Capital Charge.  Thius means we want to read a couple of records from transactional cube (differing e.g. on item) then do a calculation, then write it back as one record (new item) into the transactional cube. The Custom method is not enough to ful fill the requirements because it can be used just for status monitor updating. Does anyone have a suggestion how to implemet this. Thanks in advance,
    Murat

    I did not use any BPS or IP planning functions; that might be an approach, but I've never worked with either application.  The calculation, in my case, was done in ABAP.
    I don't have access to a BCS system at the moment, but I believe there is documentation and an example of how to implment the UC_TASK_CUSTOM BAdI delivered with the system.  Check the BAdI in SE18 and see if there is an example class listed.  I seem to remember CL_IM_EX_UC_TASK_CUSTOM or something similar. 
    There is also the documentation in the BAdI which explains exactly which importing/exporting parameters exist.  IT_SEL will include things like group currency, period, year, FYV, cons group, company, etc.  ET_MESSAGE will determine the cons monitor status when you are finished.  You can show additional results on the screen (like a regular BCS task would produce), but you need to write your own ALV.  I don't believe it is possible for this list to be available with the "last log" functionality though (I could never find a way, at least).
    uc_task_custom method is only to change status monitor
    I would disagree.  The exporting parameters, as mentioned above, determine the monitor status.  But it's also an entry point for you to develop whatever you need to meet your requirements.  Need to have a document approval process for manual documents?  You can write a custom task for that.  Need to post equity pickups back to the GL?  You could write a custom task to call an RFC or BAPI in ECC and do that.  Need to export results from from the BCS virtual cube to a flat file, basic cube, or an end user's PC?  I'd write a custom task.  Custom Document?  Custom Task.
    The issue becomes that greater development effort is required to create a custom task, than to customize a reclassification or an open hub.  If the standard functionality does not meet your requirements though, you can either change the requirements or hire a developer to implement them.
    - Chris

  • If i want to make money with this program and my knowledge of it what would be the best way to start doing work for others

    I have been doing lots of work on final cut and want to know how some of you maybe starded doing work for others to make $

    .. just to add my 5¢:
    There're several ways to moneytize your editing skills.
    ● freelance editor:
    Indeed, then first question of any client is "What apps do you handle?" I dare to say, depending in what area you live, those huge fabs searching for freelancers use very little FCPX; here, they're looking for Avid, GVproducts, maybe FC/pro...
    ● one-man-slaughter-houses aka Wedding-photographer
    If your skills are beyond editing-only, and you're an (excellent) DoP, for sure offering your 'products' is the obvious; Weddings, Bar Mizwahs, Funerals, Services, lectures, workshops, company image movies, demoes, exhibit videos... But, as other mentioned: nobody is intersted with what tools you create the film; only results count; in private products, lots of 'eye-candy' gives a happy bunny customer
    ● 'Yellow Pages': I'll make you a movie...
    I'm not doing that professional, but occasionally for money: people ask me, to grab a harddrive full of 'files' to create 'a nice movie', lately two 'flat' birthdays (30/40), tons of pics, shakey iPhone messages, music, dissolves, done. - nothing for living...
    ● Teaching?
    teach other your skills, have a look here http://training.apple.com/act
    Hurdle to go for all those: hen-egg-dillema
    People want to see your skills in advance; but without jobs, nothing to see yet.

  • Mac OS X 10.7.5 and Safari version 5.0.1 what is the best way to update the browser?

    like to know if there is an instruccions or someone can share a link on how to update safari version 5.0.1 to the latest version? ... thank you.

    Run the Software Update pane of System Preferences and then open Safari directly from the Applications folder.
    (102085)

  • How to use JSP custom tag lib in PAR file?

    Hi All,
    I am trying to customize mastheaderpar file. For that I have downloaded relevant par file and making the changes accordingly.
    As part of the changes I would require to use JSP custom tag library in my par file.
    I have the TLD file and relevant classes in the jar file. I would like to know where and what kind of modifications have to be done to use the jsp custom tag library.
    I tried modifying some things in portalapp.xml but was not successful.
    Please help me on how to proceed with this? It would be great if you can provide the xml entry to use this tag library
    Thanks
    Santhosh

    Hi Johny,
    Thanks for the reply. Actually I am able to change colors etc. with out any problem.
    My requirement is to use XMLTaglib in mastheader par file. This tag lib is from apache tomcat. I have the relevant TLD and class files. I copied TLD file into taglib dir of portal-inf and class file in src api.
    And I have added the following line in portalapp.xml under component-profile section of default
    <property name="tlxtag" value="/SERVICE/Newmastheader/taglib/taglibs-xtags.tld">
    Is this the right way to use tag lib? Actually before adding this line I used to get the error saying "Error parsing taglib", but now the error does not occur and I am getting new error. This is an exception in one of the taglib classes.
    Could any one provide me some inputs on how to check this error?
    Thanks
    Santhosh

  • What is the best way to find and apply the samples in the sap library

    I am a fresh man in the process of learning sap .
    Mainly aim at the MM and SD model .
    They all say that the best way to accomplish the task is to follow the sap on-line help.
    because i don`t know the struts of the library , so to find what i need in the library becomes impossible for me as the library includes a lot of files .
    so please some one help me to direct the struts of the library and teach me the way how to find what i want ?
    thanks

    Hi,
    This forum is for BPX. Post Solution related quries in SAP Solution Forums.
    You can access MM and SD help at:
    http://help.sap.com/erp2005_ehp_02/helpdata/en/80/ea89395eb58c4f9d0c3e837cf0909d/frameset.htm under Logistics
    or http://help.sap.com/ -> SAP ERP -> Choose Release (for example SAP enhancement package 2 for SAP ERP 6.0) -> SAP ERP Central Compoennt (MM and SD under Logistics)
    From Materials Management Link you can navigate further to Purchasing, Inventory Management etc. From Sales and Distribution you can naviate further: Sales, Billing etc.
    For example to see help regarding Purchase Orders:
    You would first expand Logistics and choose Materials Management in Help Link for ERP Central Component. Here, choose Purchasing Node which will take you Purchasing Help screen -> Click and Purchase Orders Node and Expand the same for more information regarding Purchase Orders.
    You should be comfortable with SAP help link.
    Regards,
    Naveen.
    Search the forum with keywords before posting the query.

  • What isa the best way to reorganize my photos from multiple libraries to a single library

    I need to reorganize my photos from multiple libraries to a single library. What is the best way to do this?

    The only way to do this while preserving all your metadata, versions and so on is with the paid version ($20) of
    iPhoto Library Manager

  • Which is the best way of deploying JSP (mod_ose or OSE) ?

    I need to deploy some jsps that are using servlet api 2.2 and i would like to know which is the best way of deploying these jsps?
    Thanks
    RJC

    Speaking of JServ Vs OSE, I have some related questions on it. I would appreciate if someone can answer:
    1.For a stateful servlet (assuming that we are using Oracle JVM), Will it not call the init() method of the servlet each time for a client (because each client will have his own Oracle JVM)? If so, isn't that expensive because it needs to initialize the servlet again?
    Again, for the same servlet, Will it not have a servlet context for each and every client? Isn't that expensive? ( A servlet context by definition maintains state information for all instances of a web application within any single JVM)
    2. If we have an application that has some portion of it which is stateless and some portion of it which is stateful, how do we make a choice JDK JVM vs Oracle JVM?
    Can we (for the same application) use both the JDK JVM as well as Oracle JVM? If so, how does the JDK JVM talk with Oracle JVM?
    3. Since Oracle JVM is useful for stateful applications only, does it mean that we cannot use it for Stateless session beans? (In an application we might have stateless session beans, stateful session beans as well as entity beans) Should we be using JDK JVM or Oracle JVM?
    4. For Servlets too, we might have stateless servlets and stateful servlets within the same application. If so, can we use JDK JVM for stateless servlets and Oracle JVM for stateful servlets? If so, how does the JDK JVM talk with Oracle JVM?

  • Problem in using jsp 1.1 custom tag library in websphere

    I am using was 3.5.2. Everything has been installed properly. I am using jdeveloper 3.2 for building the jsp application using custom tag library. But when I run the jsp file in browser, its gives dr. watson on java.exe. I am using websphere 3.5.2 application server.
    Have any body got this type of prob. ...
    pls respond asap.
    Thanks in Advance
    Yogesh

    Let me explain the problem again
    I am using was(websphere) 3.5.2. Everything has been installed properly. I am using jdeveloper 3.2 for building the jsp application using custom tag library.
    Application works fine in JDeveloper 3.2.
    Application works fine even when deployed on JRun 3.0. ( we are evaluating various web servers).
    How when deployed on WAS and I run the jsp file in browser, its gives dr. watson on java.exe. I am using websphere 3.5.2 application server.
    WAS has typical settings as against JRun and Tomcat and may be I have not set the necessary paths.
    Have any body got this type of prob. ...
    pls respond asap.
    Thanks in Advance
    Yogesh
    null

Maybe you are looking for

  • Two IPAD 2s with same IMEI # - horrible customer support to resolve issue

    A week ago my boyfriend discovered that Verizon had disconnected service to the iPAD 2 I gave him from his account 7 months ago but continued to charge him $11.21 per month for the phone line on a non-existent device.  To date I have spoken with more

  • PC Suite Calendar problems

    Hi, few days ago I've noticed that my PC Suite - Nokia Communication Center doesn't show curent day in light blue color anymore. That's in the week view, but when I switch to month view todays date is blue. Is there a option to turn it on? Or is it m

  • How to reload embedded oc4j in JDeveloper without terminating it?

    To the experienced: Using JDeveloper (10.1.3.4), when I need to see the effect of my changes in the application code (in the backing beans), the only way I know is to terminate the embedded oc4j by clicking the red square button (or Run > Terminate >

  • Regarding Point SYstems on technet

    Hi Geeks and moderators, 1)Just want to know how the point system works on technet as how many points for correct,quickly answered,voted answers. I realized have given several answers which are correct as per google information still no one marks it

  • Table for user's Full Name

    Hello everyone, this is my first post in this great forum, well my doubt is about full name for any user, for example mi id is cventuro , where can i fin my full name (Carlos Venturo), in wich table, i looked in usr* with no success. Thanks in advanc