Does WebSphere pool the connections from Mail session?

Hi,
I configured a mail session in WebSphere through the console under 'Mail Providers' and did a lookup of the jndi name as below:
try{
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
javax.mail.Session mailSession = (javax.mail.Session) ctx.lookup("mail/TestSession");
MimeMessage mm = new MimeMessage(mailSession);
Transport.send(mm);
catch (MessagingException me) {
}It looks like if I invoke this piece of code 10 times, then 10 connections to the mail server is established to send the message. Doesn't WAS handle the connection pooling under the returned MailSession object?
Thanks

Ok..this is very confusing...we created a singleton class to hold the mail session and the connected transport like this:
public class MailCache
     private static MailCache sessionPool = new MailCache();
     private static Session mailSession ;
     private static Transport transport;
     static {
          try
               mailSession = (Session) LookupHelper.lookup("mail/TestSession");
               transport = mailSession.getTransport();
               transport.connect();
     public static Transport getTransport() {
          if (transport == null) {
               try
                    transport = getMailSession().getTransport();
                    transport.connect();
               catch (NoSuchProviderException e)
                    e.printStackTrace();
               catch (MessagingException e1)
                    e1.printStackTrace();
          else {
               // transport exists, check if connected!
               if (!transport.isConnected()) {
                    try
                         transport.connect();
                    catch (MessagingException e)
                         e.printStackTrace();
          return transport;
     public static Session getMailSession() {
          if (mailSession == null) {
               System.out.println("Mail session scoped out");
          return mailSession;
}and this is how I send the mail:
MimeMessage message = new MimeMessage(MailCache.getInstance().getMailSession());
Transport transport = MailCache.getInstance().getTransport();
transport.send(message);
...When I send a bulk mail (for e.g. 20 messages) in a loop (setup as a junit) I notice that 21 connections are established on the smtp server trace for sending the messages. All the connections process exactly 1 message and get disconnected after sending the message. But one connection (i presume its the one that Ia, holding open in the singleton) is never used at all!. What Iam trying to acheive is to have only 1 connection open from my server to send messages. What am I doing wrong?

Similar Messages

  • When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    gonsa47 wrote:
    When I open it in pages or word the correct company logo appears.
    Does the mail app display whatever is in the document without the ability to differentiate between hidden or non hidden images?
    The mail app will not display fillable form fields in PDF files that can be seen in real PDF apps. I say real PDF apps because the form fields in PDF apps will not appear in the iBooks app either. IMO, iBooks is not a real PDF app.
    So, I would say that the mail app cannot differentiate between hidden and non hidden items

  • Log onto incoming mail server (POP3): Your server does not support the connection encryption type you have specified. Try changing the encryption method. Contact your mail server administrator or Internet service provider (ISP) for additional assistance.

    Hi All,
    This is my first post to ms exchange forum am getting  Log onto incoming mail server (POP3): Your server does not support the connection encryption type you have specified. Try changing the encryption method. Contact your mail server administrator
    or Internet service provider (ISP) for additional assistance. in my outlook clients, till last Sunday (12.04.15) my exchange was well & good, Monday morning suddenly the problem started like none of our outlook pop3 clients are able to communicate
    with exchange (rest  IMAP, SMTP & Exchange accounts are working fine). i have tried with all port no but no luck. please help me to get raid of this one.
    Exchange 2013 CU6 with server 2012 Std 64Bit
    Thanks,
    Murali 

    Dear All,
    I have found the solution for above problem, the problem has occur due to PopProxy inactivity
    please find relevant exchange management shell commends below.
    1. Get-ServerComponentstate -Identity <yourmailserver.com> 
    Server Component State
    yourmailserver.com ServerWideOffline Active
    yourmailserver.com HubTransport Active
    yourmailserver.com FrontendTransport Active
    yourmailserver.com Monitoring Active
    yourmailserver.com RecoveryActionsEnabled Active
    yourmailserver.com AutoDiscoverProxy Active
    yourmailserver.com ActiveSyncProxy Active
    yourmailserver.com EcpProxy Active
    yourmailserver.com EwsProxy Active
    yourmailserver.com ImapProxy Active
    yourmailserver.com OabProxy Active
    yourmailserver.com OwaProxy Active
    yourmailserver.com PopProxy Inactive
    yourmailserver.com PushNotificationsProxy Active
    yourmailserver.com RpsProxy Active
    yourmailserver.com RwsProxy Active
    yourmailserver.com RpcProxy Active
    yourmailserver.com UMCallRouter Active
    yourmailserver.com XropProxy Active
    yourmailserver.com HttpProxyAvailabilityGroup Active
    yourmailserver.com ForwardSyncDaemon Active
    yourmailserver.com ProvisioningRps Active
    yourmailserver.com MapiProxy Active
    yourmailserver.com EdgeTransport Active
    yourmailserver.com HighAvailability Active
    yourmailserver.com SharedCache Active
    2. Set-ServerComponentState -Identity <yourmailserver.com> -Component PopProxy -Requester HealthAPI
    -State Active
    3. Get-ServerComponentstate -Identity <yourmailserver.com> 
    Server Component State
    yourmailserver.com ServerWideOffline Active
    yourmailserver.com HubTransport Active
    yourmailserver.com FrontendTransport Active
    yourmailserver.com Monitoring Active
    yourmailserver.com RecoveryActionsEnabled Active
    yourmailserver.com AutoDiscoverProxy Active
    yourmailserver.com ActiveSyncProxy Active
    yourmailserver.com EcpProxy Active
    yourmailserver.com EwsProxy Active
    yourmailserver.com ImapProxy Active
    yourmailserver.com OabProxy Active
    yourmailserver.com OwaProxy Active
    yourmailserver.com PopProxy Active
    yourmailserver.com PushNotificationsProxy Active
    yourmailserver.com RpsProxy Active
    yourmailserver.com RwsProxy Active
    yourmailserver.com RpcProxy Active
    yourmailserver.com UMCallRouter Active
    yourmailserver.com XropProxy Active
    yourmailserver.com HttpProxyAvailabilityGroup Active
    yourmailserver.com ForwardSyncDaemon Active
    yourmailserver.com ProvisioningRps Active
    yourmailserver.com MapiProxy Active
    yourmailserver.com EdgeTransport Active
    yourmailserver.com HighAvailability Active
    yourmailserver.com SharedCache Activ
    Replace yourmailserver.com with your server host name.
    Thanks

  • PC Suite does not support the connected phone........

    Hi...
    I have a big problem in the delivery of mobile and my type is N70 with Computer shows a message saying that some files missing from the mobile and this is the message that appears when connectivity.
    PC Suite does not support the connected phone. PC Suite settings file is missing from the phone. Switch off your phone, switch it on, and try again.
    Please assist in this matter, I can either send a site that I downloaded through by mobile phone.
    thank you very much..
    Moderator note: telephone number removed. It is not advised to publish personal contact information on a publically-accessible web forum.
    Message Edited by michaels on 14-Feb-2008 08:40 PM

    Hi Guys,
    It always better to give more information when you are posting your issues....Please try to give your system info, versions of the pc suite you are facing the issue :-( so that it may help others to narrow down ur issues :-)

  • Ovi Suite/PC Suite does not recognize the connecte...

    Error message: "Ovi Suite/PC Suite does not recognize the connected phone.Ovi Suite/Pc Suite cannot read the required information from the phone.Check that the connected phone is supported by Ovi Suite/PC Suite".
    You can try this which can solve your problem.
    1. Disconnect your phone from PC if connected.
    2 .Open Control Panel and go to ‘Programs and Features’
    3. From the list of available programs, choose ‘Nokia Connectivity Cable Driver’
    4. Click on the ‘Change’ button on top toolbar. 
    5. In the setup dialog box that pops up next, choose ‘Repair’ and select ok. Wait for setup to complete.
    6. Restart the computer if prompted.
    7. Now connect your phone to the PC. Driver installation should complete and PC/Ovi suite (hopefully) should detect your mobile properly now.
    Please THANK me by clicking on the ****WHITE STAR** ( Giving KUDOS) the big GREEN BOX to your LEFT .
    It will help me to serve you better !!!!!
    Thanking You

    @ Omarbooyaka,
    Welcome to the forum! You should use Nokia Suite to update your device to Belle. If still the same, please go to control panel > printer and devices > right click the phone icon > remove the device. Then try to connet again. Also try all the steps provided by magovoru. Could you also report the issue here if connection still does not work.
    Hope this helps!
    Jampe
    If the answer solves your issue, please click the ACCEPT AS SOLUTION button so other users can benefit from it as well. Giving a kudos (the white star) if my answer has helped will be appreciated.

  • HT4235 my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection? i just want it to connect to my itunes again!!!

    my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection?
    i just want it to connect to my itunes again!!!
    Thank you to anyone and everyone that manages to help!

    Hello webster995,
    Thank you for the details of the issue you are experiencing with your iPhone not appearing in iTunes.  I recommend following the steps in the article below to troubleshoot the issue you described:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • What is apple doing to fix the bugs from IOS 7.1.2 update? this update has ruined my phone

    What is Apple doing to fix the bugs from IOS 7.1.2 update??? This update has ruined my phone! Why would you put out a update you know is going to ruin someones phone? Whats being done? I have tried everything to fix my phone which was just fine before Apples IOS 7.1.2 update!!!

    I have also experienced issues with my iphone5 since updating to ios 7.1.2, prior to this update my phone was working perfectly fine and I know I didnt cause any damage to the phone because I baby my iphone as if it was my child. Ever since I updated to 7.1.2 my phone shutts itself down while I am using it, it can be while using whatsapp, browsing the internet or using apps, more than anything it fails while using the internet. The screen will either start to flicker or vertical lines will pop up and then the phone will fade to black, after this happens the phone will get really hot and to turn it back on I have to wait 5-10 minutes and hold down the power and home keys at the same time for about 15 seconds for it to turn back on, I have to wait 5-10 minutes because if I dont when I boot it back up it immediately shutts down again. This is a constant all day thing and for now i get by just making phone calls and sending regular text but I try to keep the action down to a minimum to prevent missing a phone call. I tried clearing the phone and rebooting it to original setting but this didnt fix it. After reading and speaking with several techs they tell me that ios 7.1.2 rolled out some performance adjustments one particular that affects the amp levels that the battery works at and supposedly the iphone 5 cant handle it, they explained that the phone for certain activities is asking for more or less power and the phone panics into safe mode and shutts itself down. My battery life is fine so I havent changed the battery like someone had suggested. In the diagnostic data it gives a panic.ips error. Id really like to know if there is any possible way to roll back to 7.1.1 through jailbreak or any other way, I was perfectly happy with this phone and didnt plan on buying another one for atleast 1-2 more years. If anyone can help me out this would be greatly appreciated, if not I hope apple is working to fix this.

  • I want to mirror an iOS device to my computer for demonstration and training purposes.  I cannot use Airserver as my company VPN does not allow the connection.  Is there a hardware solution instead?

    I want to mirror an iOS device to my computer for demonstration and training purposes.  I cannot use Airserver as my company VPN does not allow the connection.  Is there a hardware solution instead?

    Shoeb, hi.
    Thanks for replying and apologies for my tardiness in responding. I have just completed a re-creation of my web page using CSS/HTML rather than XML/XSLT and now I find that when saving in MHT format the watermark/background image is saved, which is nice, but trying to save it as 'webpage complete' under 'save as' in the browser still does not work. (For those who are new to Firefox, MHT files are not supported by the browser, but using the FF extention UnMHT one can open such files and save web documents as MHT files, meaning no accompanying folder is required to properly view the file.)

  • When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    That's probably because the message is in HTML format. Send the reply as plain text.

  • HT6154 how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    Download what files?
    What is the actual problem that is occurring?

  • The Connect from Intel Pro/1000 T to 1000base-t Port on Catalyst 4000 (WS-X4412-2GB-T= module) Not Working Properly

    The connect from Intel Pro/1000 T to 1000base-t port on Catalyst 4000 (WS-X4412-2GB-T= module) is not working properly. The Intel Pro/1000 T NIC connects to a 10/100 OK. Auto-negotiation is set at both ends. We can successfully ping across the link. However performance is so poor as to make the connection unusable.

    When an Intel Pro/1000 T NIC is connected to a Catalyst switch, the customer may see poor network connections or excessive numbers of dropped packets. The problem arises when a module with a TBI interface transmits an odd byte packet to a receiver with a Gigabit Media Independent Interface (GMII).
    The interoperability issue is a result of the implementation of Carrier Extension. Carrier Extension is detailed in sub section 35.2.3.5 in the IEEE 802.3 specification. Carrier Extension can be used to pad the last byte of a packet, so the packet is aligned on an even numbered boundary.

  • Delete an email from the pc,  does not delete the email from the iPad.

    Hi
    When I Delete an email from the pc,  does not delete the email from the iPad.  I'm not able to find a setting to fix this.  Does it mean I have to manually delete the emails from the iPad? 
    Thank you in advance for your help.

    Thanks, I was told that my Yahoo account has to be setup on the Mac as a POP account.  Can you please let me know what the difference is (in simple terms) between IMAP and POP? 

  • HELP - PC Suite does not support the connected pho...

    After trying numerous times now I cannot get my question to you via your website. In utter frustration I am posting my problem here.
    My problem is as follows
    When I connect my phone via cable to my laptop I get the following error message. 'PC Suite does not support the connected phone. Install a correct version of PC Suite and try again'. I have already uninstalled the version that previously worked fine and downloaded the version recommended by your website which is 6.80.22. This is actually the version I already had which previously did work. I amd still getting the same error message despite uninstalling and reinstalling numerous times. And when I plug my phone into my partners computer it works fine. He has the same operating system and version of PC Suite. I am using Windows XP Home Service Pack. I have a Nokia 6131

    Thanks for the descriptive posting, unfortunately there are still many things that can be wrong.
    You should try the things that are suggested here in many places: go to control panel - add/remove programs and select first Nokia PC Connectivity Solution and run a repair to it by selecting change - repair. Then same thing for Nokia PC Suite, run a repair to it.
    Then boot PC.
    Then check the PC Suite manage connections icon to make sure that the DKU-2, CA-53 USB connection is activated.

  • I updated my iPhone today over wifi.  It downloaded 6.1.3 completely and started then installed it.  After the install all it does is show the connect to iTunes screen.  What did I do wrong and now do I have to completely restore the phone?

    I updated my iPhone today over wifi.  It downloaded 6.1.3 completely and started then installed it.  After the install all it does is show the connect to iTunes screen.  What did I do wrong and now do I have to completely restore the phone?

    Next question.... I did an iCloud save point earlier today so in theory everything should have been saved and the restore won't be a complete loss right?  Please tell me my pics aren't gone.....
    Thanks for the help.

  • Why does using a digital connection from headphones out on a Mac into a stereo disable the master volume control on the Mac?

    When you use an analog connector, it does not disable the master volume on the Mac. It's only when you use a digital connector, and it's ALL digital connectors. It still allows you to use the iTunes volume control but, when you stream anything else on the web on your computer, you have to use the stereo's volume control because the master volume control on the Mac has been disabled. Does anyone know why?

    I had the same problem, instead of logging in the router with the iMac (impossible) I did it with my iPad, I guess you can do the same with an iPhone.
    -Disconnect the iPad from your wifi network and connect it to the TP-Link repeater.
    -Open the web browser (I use chrome) be sure you don't have any other open tab, just the one to access tptlinkextender.net
    -The configuring page opens, from there follow the steps of detecting your network and adding the password.
    *If your MAC address is hidden it'll appear without name, in that case you have to configure it manually (write the name on the space for that)
    Now go, be happy and do good.

Maybe you are looking for

  • I have a printer failure that I cannot get past

    Error reads like this:  These solutions have been repeated several times over the last few hours....I am ready to throw this through the window. I have had nothing but problems with MY PRINTER< you know the one I purchased with cash and I do not want

  • "File could not be found" message on top of all images in Library:  How do I fix this?[was:Question]

    New to LR 5.2 Running OS X 10.8.5. Tried to save image in file folder. Now get this message at top of all images in Library: "File could not be found." How do I fix this?

  • Odd message when copyying to another disk

    I'm trying to copy from one FW drive to another. I tried moving some .mov files but something screwed up, now they're grayed out and when I try to trash them I get the message file in use by another application, but no other application is open. Now

  • Playlists Where are my songs

    Hi everyone, new to the I Phone, and ITunes. I have made playlists on I Tunes and checked Sync Playlist and checked all the lists I want on my phone and synced them. But some of the playlists on my phone are empty and some are fine, all the songs are

  • How to Get Side-Panel is Gnome 3 ?

    i installed gnome 3 but something is lacking :-/ side-panel , it comes in some additional package ?