How to instantiate App Mod in bean not tied to a specific page or session

I have come to the conclusion that I can't initialize the BC4J framework (e.g. initialize properties for the connection pool) until I create an instance of an App Mod. How can I do this in a static initializer block of a bean that is not tied to any particular page or user session or pageeContext?
I am trying to share the database connection pool across not only app modules but some of our pages that need to connect to the db but do not have app modules on them. But when I try to get the ConnectionPoolManager instance, it fails (UNLESS a page with an App Module on it was loaded first). If I try to get the instance first I get a nullpointer exception. Important note: I am in my own connection wrapper class so I do not have a session or pageContext.
I do this in my static initializer block of my class:
poolManager = ConnectionPoolManagerFactory.getConnectionPoolManager();
(this throws a null pointer exception)
and I've traced the error to this line in the ConnectionPoolManagerFactory getting null back:
String s = PropertyMetadata.PN_POOL_MANAGER.getProperty();
I suspect it is because the oracle.jbo.PropertyManager.loadProperties has not been run yet. The javadocs says: "This class is used at
framework initialization time to choose values for the various properties".
So, my questions are:
1) If I have to invoke an app mod instance to make this work....What's the simplest way to create an app mod instance from a bean that is
not tied to a session?
or 2)
1) Is there a way that I initialize the framework from my bean without instantiating an app module?

John,
First of all, thanks for the response. You provided workable answers for both possible approaches and I appreciate that. However, I am having a problem with both due to my unique situation....1) we are using JDeveloper 3.2 which doesn't have the SessionCookie class so while I can get an instance of an App Module, I can't do the next part which apparently is necessary to initialize the framework...2) I tried your other recommendation about calling the System.SetProperty method for the connection pool manager class and it worked!.....however, it instantiates the connection pool with default settings and not with my pool properties in my jboserver.properties file which I need.
Norm
Hi,
Please see the discussion thread at:
Re: Maintaining the state between http requests
for more information about using the BC4J connection pool from an external Object.
So, my questions are:
1) If I have to invoke an app mod instance to make this work....What's the simplest way to create
an app mod instance from a bean that is not tied to a session?.
You can use the oracle.jbo.common.ampool.PoolMgr directly to find/create a pool. For instance:
ApplicationPool pool = PoolMgr.getInstance().findPool(
"Mypackage1ModuleLocal" // pool name
, "mypackage1" // config package name
, "Mypackage1ModuleLocal" // config name
, null); // additional properties
SessionCookie cookie = pool.createSessionCookie(
DUMMY_APPLICATION_ID // application id
, DUMMY_SESSION_ID // session id
, null); // additional properties
cookie.useApplicationModule();
cookie.releaseApplicationModule(
true // checkin
, false); // manageState
pool.removeSessionCookie(cookie);
or 2)
1) Is there a way that I initialize the framework from my bean without instantiating an app module?.
Please see the original post referenced above.
Hope this helps.
JR

Similar Messages

  • How do I stop Firefox from crashing? It crashes at various times, not when loading any specific pages.

    My crash problem has been going on for week, now. I tried uninstalling FF and reinstalling it. I hoped that would fix the problem, but it didn't. Crashes occur randomly, when loading or reloading pages but they are NOT specific pages. The Report ID listed below is just 1 of several reports from the past week.

    I am unwilling to attempt navigation away from these sites. The pop-ups that occur on the attempt to leave a site or to close the browser are exit traps offering incentive to stay.
    Once upon a time, when the internet was less dangerous, I would be willing to close the exit pop-ups. Now, after twice being infected with malware trying to close the pop-ups, I now force close whichever browser I am using.
    Recently, I clicked on the red X to close one pop-up, and it installed a trojan that I had to pay to be removed. When I clicked on 'Leave' in another exit pop, it didn't exit and it turned out I was giving permission to run a script file. Now that criminals have learned these exit pop-ups can be used to force a click action, the sites using them have become dangerous.
    If I force the browser to close using Task manager, Please tell me how to stop FireFox from sending me directly back to the same site because it mistakenly believes it crashed when it did not. I forced it to close because I was on a site that had taken control of my browser and was not allowing me to leave the site.
    No other browser sends me back to the potentially dangerous sites. I prefer Firefox, but the new version must have a setting that allows me to get safely away from a problem site?

  • My ipod touch it frozen in a apps mode and will not respond how do I correct this

    my ipod touch is frozen on an app and will not respond to anything what can I do to correct this?

    Try here:
    iPhone and iPod touch: Frozen and unresponsive

  • How to remove App from iPhone, but not iPad

    I have an App that I would like to keep in my iTunes library, but only Sync to my iPad -- not my iPhone.  Right now, the App has been 'deselected' from my iPhone, but the associated file size did not decrease.  My iPhone still has 1GB more than I would like.  How can I remove the App and it's file from my iPhone, but preserve it on my iPad?  Thanks!

    Deselect it and sync.
    Is it still on your iphone?
    Apps are generally not that large.  I doubt you would notice much difference in memory used.
    Look on the iphone to see if the app is there.

  • How to keep apps for later and not have iTunes prompt for an update?

    can I get iTunes to stop offering me an update for an app I have unchecked for now but am not ready to delete permanently?  I have some I bought that, for now I don't wish to use.  Some are organizational apps, and I bought them to see if they would work for me.  So far, I am still not clear which one works best for me so I want to keep it in my itunes library, to try later, when I have more time.  I have unchecked it on my iphone and ipad and for when I sync, but when I check updates, they are always listed in the update list.  With them there, I cannot check, update all, and have to type in my password for each individual download, which as we all know, on an iphone, if you have a good password to keep your itunes account from being hacked, can be a pain to type repeadly.  But basically, I want to know if I can avoid being prompted to download and update for an app that I which to 'keep on the shelf' for now, since I believe that if I delete it from itunes permanantly, I would have to buy it again, should I want to try it out again.
    I appreciate any help you can give me.  I did do a search for my question but only found how to permanately delte apps in itunes.  If there is a clear answer in a thread, I'd be happy to know what it is.
    Thank you,
    Michelle

    As with your iPod when connected to iTunes, the iPhone has various tabs for your iPhone sync preferences with iTunes. Your iPod and your iPhone can have different sync preferences.
    If you don't want to transfer any music to your iPhone, don't select Sync Music under the Music tab for your iPhone sync preferences. If you don't want to sync any video to your iPhone, don't select sync Movies and TV Shows under your iPhone sync preferences.
    Under the Applications tab for your iPhone sync preferences, you will select Sync Applications with the following options below.
    All Applications to transfer all available applications to your iPhone, or choose Selected Applications followed by selecting the applications in the window below that you want transferred to your iPhone followed by a sync.

  • How to sync apps for ipone and not music, but keep music for classic

    Hey
    I am getting the iphone 3G, 16gb, and I have an ipod classic 80gb. I want to keep everything I have on the classic the same; the music, videos, games. However, for the iphone I dont want to add the music of videos, just the apps.
    Is there a way to do this? If so could yuo explain in detail, thank you.

    As with your iPod when connected to iTunes, the iPhone has various tabs for your iPhone sync preferences with iTunes. Your iPod and your iPhone can have different sync preferences.
    If you don't want to transfer any music to your iPhone, don't select Sync Music under the Music tab for your iPhone sync preferences. If you don't want to sync any video to your iPhone, don't select sync Movies and TV Shows under your iPhone sync preferences.
    Under the Applications tab for your iPhone sync preferences, you will select Sync Applications with the following options below.
    All Applications to transfer all available applications to your iPhone, or choose Selected Applications followed by selecting the applications in the window below that you want transferred to your iPhone followed by a sync.

  • Please someone has to know how to delate the text box and not the word or the page

    HI
    someone has to help i am trying to make a wedding invites on word but we dont want the text box how do you get rid off it with out dealeting the page.
    What is a good progame to use to created wedding invites?

    Then you should probably post your question on the Microsoft Mac forums since it's their software you have questions about...
    http://answers.microsoft.com/en-us/mac

  • How can I get a new tab to open to a specific page?

    I use speed dial add-on and have for a few years. I had an issue with firefox yesterday and had to reinstall it and lost all my settings. I added the speed dial add-on and tried to set it as my home page, but when I restart instead of going to speed-dial it goes to a new tab page and the homepage has changed in the options setting. No matter how many times I try and switch startup page/home page to speed dial, it keeps changing back to new tab.

    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • How to keep track of which tab is currently active in the page using Session object?

    Hi,
    Just curious as to whether it is possible to have a PL/SQL event fire on an active tab.
    The reason is I want to keep track of which tab is currently active on the page is that I have "generic" forms and reports published as portlets that I wish to be able to determine from the session object what page/tab the user is coming from and apply certain restrictions etc.
    kind regards,
    Matt.
    null

    Hi Konstantina,
    Yes You can do like that 2012-->q1-->January
    Steps:
    1. Create time dimension hierarchy as by following like Total--> year--> Quarter--> Month--> if you need you can keep Description.
    2. Drag the Year column from period dimension table to the dimension hierarchy of year.
    3. Drag the quarter column from period dimension table to the dimension hierarchy of Quarter.
    4. Drag the month column from period dimension table to the dimension hierarchy of month.
    5. Drag the hierarchy to period dimension table in presentation layer.
    In Answer side keep as it as Default: drill in primary and secondary interaction under column properties.
    For more refer : http://mkashu.blogspot.com
    Regards
    VG

  • HT1349 How to delete app from itune

    How to delete app that I have not install from iTune

    From your iTunes library on your computer? Right-click the App in your Apps library, select Delete, then move all files to trash, then empty your trash.

  • After installing ios6 I now have app downloads stuck in waiting mode. I went to down in App Store but could not find a way to disable them. How can I do this. I never had this problem on ios5. I'm using an iPad 3

    After installing ios6 I now have app downloads stuck in waiting mode. I went to downloads in App Store but could not find a way to disable them. How can I do this. I never had this problem on ios5. I'm using an iPad 3

    Try downloading in iTune (computer) and sync to iPad.

  • When the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently.but in fact,when the app in background ,the app need data update to make the

    when the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently。but in fact,when the app in background ,the app need data update to make the function of  trajectory replay come ture。in fact, we have added function when the app  is in background mode。we have point out the point to them by email。but they still have question on the background mode,we are confused,does anyone can help me,i still don't know why do review team can't find the data update when  the app is in background and how do i modify the app,or what is the really problem they refered,do i misunderstand them?
    the blow is the content of the review team email:
    We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.
    We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.
    It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the "location" setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.
    For more information on these options, please see the "Starting the Significant-Change Location Service" and "Monitoring Shape-Based Regions" sections in the Location Awareness Programming Guide.
    If you choose to add features that use the Location Background Mode, please include the following battery use disclaimer in your Application Description:
    "Continued use of GPS running in the background can dramatically decrease battery life."
    Additionally, at your earliest opportunity, please review the following question/s and provide as detailed information as you can in response. The more information you can provide upfront, the sooner we can complete your review.
    We are unable to access the app in use in "http://www.wayding.com/waydingweb/article/12/139". Please provide us a valid demo video to show your app in use.
    For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
    - complete details of your rejection issue(s)
    - screenshots
    - steps to reproduce the issue(s)
    - symbolicated crash logs - if your issue results in a crash log
    If you have difficulty reproducing a reported issue, please try testing the workflow as described in <https://developer.apple.com/library/ios/qa/qa1764/>Technical Q&A QA1764: How to reproduce a crash or bug that only App Review or users are seeing.

    Unfortunately, these forums here are all user to user; you might try the developer forums or get in touch with the team that you are working with.

  • IE 11 not launching in app mode

    IE 11 will not launch in app mode, it only will launch in desktop mode. I have read the other posts and my issue is different. There are no other browsers on my machine than IE 11. In the control panel, in internet options, I set internet explorer
    to the default setting for all programs. I then unpin IE from the metro start and repin it to the start. Same damn result happens every single time, it will launch in desktop mode. I've rebooted, deleted cache temp files, cleaned registry...nothing changes
    the result.
    Here is the kicker, two days ago it worked for 5 minutes! There are no other software on this machine, it is a brand new Lenovo Yoga 11s. What is up with this browser not running in app mode?

    Hi,
    Please take a look at this settings:
    Click the tools button in IE 11(IE 11 on the desktop), choose
    Internet options, navigate to programs tab, on the
    opening Internet explorer, choose how you open links:
    Make sure we have always in Internet explorer or Let Internet Explorer descide selected.
    For more information regarding the options, please check the part Can I make Internet Explorer for the desktop my default browsing experience? in the link below:
    Internet Explorer 11 - FAQ for IT Pros
    Hope this may help
    Best regards
    Michael Shao
    TechNet Community Support

  • HT5557 How to set Night mode on Ipad Mini iBooks apps when reading PDF file?

    How to set Night mode in iBooks (ver 3.1) for iPad Mini?

    It's not available within the iBooks app  for PDFs, the closest you can get is to the Invert Colours accessibility option  (though pictures will appear negative) -  you can set Settings > General > Accessbility > Triple-Click Home to 'Invert Colours', which means that you can then use a triple-click of the home button to go to white text on a black background.

  • HT4356 My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    hi
    could you tell us what the other app is please

Maybe you are looking for

  • NUMBERS: How do I delete pages within a sheet?

    Using NUMBERS:  HOW DO I DELETE PAGES WITHIN A 'SHEET' ?

  • JSF 2.0 ViewState

    I could not find any running example of JSF 2 Viewscope with reference implementation or thru RichFaces even. Have tried it on Netbeans/Glassfish as well but still Constructor is getting called again and again on each request. Isn't view scope yet re

  • One question about dreamweaver cc layers

    Hello! Help please, how create a new layer with text over pictures? *Only In dreamweaver 13 cc! Thanks

  • Ibot-publish for subscription issue.

    Hi Everyone I have a issue in which the user cant save the i-bot in the shared i-bot folder after he checks the publish for subscrition functionality. The user gets access denied when he tries to save it in that folder. I know we can do it by giving

  • Exporting large file premiere keeps crashing

    I am exporting the 26 minute file as a h264 1080p 25 with a VBR 1 pass (only because it seems to usually crash with a 2 pass) and have reduced the Target Bitrate to 32 with a maximum nitrate of 40. estimated file sizes 6036 MB. its too large for what