How to get connection from TopLink
Hi All,
I am facing problem in production while getting connection through JNDI.
Since i need some result from the view and some other data for business functionality. My toplink connection is working fine....but when i try to get connection through JNDI its failing because of network issues or more connection is opened in DB side. But toplink connection is working fine.
So i want to use the toplink connection instead of JNDI to get my result.
For that i used all the solution given in the forum to get the connection from top link. But when i using those thing it shows the method are deprecated.
import oracle.toplink.internal.sessions.UnitOfWorkImpl; --- In this package all the methods are deprecated so i used this package (import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl;)
UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
uow.beginEarlyTransaction();
connection = ((UnitOfWorkImpl)uow).getAccessor().getConnection();
import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl;-----
when i used this package i am getting below exception
08/12/21 09:58:20 java.lang.ClassCastException: oracle.toplink.internal.sessions.UnitOfWorkImpl
08/12/21 09:58:20 at mof.egov.portal.POMasterDetailSessionEJBBean.checkValidSupplier(POMasterDetailSessionEJBBean.java:2207)
08/12/21 09:58:20 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08/12/21 09:58:20 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
08/12/21 09:58:20 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
08/12/21 09:58:20 at java.lang.reflect.Method.invoke(Method.java:585)
Anyone help me to resolve the issues.
Note : I am using, JDeveloper 10.1.3.3, EJB 3.0 (Stateless Session), TopLink
Thanks & Regards
VB
Vimilan,
Hi, try the following JEE snippet of EclipseLink code, the connection code you are using is for non-EE (SE EntityManagers - I received the same CCE as you in the past).
[http://wiki.eclipse.org/EclipseLink/Examples/JPA/EMAPI#Getting_a_DataSource_from_an_EntityManager]
Normally you let the JPA container manage all interaction with the datasource for your application. However, if you do require access to the datasource or connection in use by your JPA application, the following code should help you.
The following line of code will get the current JTA or non-JTA datasource in use by an entityManager in a container managed JPA application using a JTA transaction-type.
DataSource from a Container Managed EntityManager
DataSource aDataSource = ((JNDIConnector)((DatabaseLogin)
((UnitOfWorkImpl)((JpaEntityManager)entityManager
.getDelegate())
.getActiveSession()
.acquireUnitOfWork())
.getProject()
.getDatasourceLogin())
.getConnector())
.getDataSource();{noformat}
Connection from an SE EntityManager
The following code will return a null connection or cause a (non-narrow()) $Proxy ClassCastException if run on a container managed EntityManager, it is supplied for SE applications or one using the JavaSECMPInitializer or a RESOURCE_LOCAL transaction-type.
Connection aConnection = ((UnitOfWorkImpl)((JpaEntityManager)entityManager)
.getActiveSession()
.acquireUnitOfWork())
.getAccessor()
.getConnection();
thank you
/michael [http://www.eclipselink.org|http://www.eclipselink.org/]
Edited by: michael_obrien on Dec 21, 2008 2:16 PM
Similar Messages
-
How to get Connection from Internet
I have Internet Connection having
Localhost I.P Address : 127.0.0.1
Network I.P Address : 192.168.0.26
Proxy I.P Address: 193.251.135.124
Real I.P : 203.135.59.209
I have TCP client server Sources, when I listen the port on my PC at 1000, I can send the request from client version if I use Server I.P as
Localhost
Lan Ip 192.168.0.26
But if i send it on Proxy or Real I.p , server hosted on same machine cannot recive,
Then How a Client Connect to My PC, without Any Server...
Any Idea????????Currently, the Airport Express (not the Airport Express Extreme router) is acting as a base station via Ethernet to a cable modem.
I guess that it would be correct to assume that your new Mac can connect wirelessly to the AirPort Express base station, and access the Internet that way.
I am not sure if my 41/2 year old HP(Hewlect Packard) PC - (with AMD Athlon 64 3400 processor) which I am unable to get internet connection now is Wi-Fi capable.
You said "Prior to using the new Airport Express,I was using the Linksys wireless G router and have a wireless adapter sitting on top of my PC.". The wireless adapter would be Wi-Fi certified (they normally are). Is it a USB adapter? Please post back with the exact model.
Question: do I still need to use the adapter or not? Or the new Airport Express is enough to send internet signal to the PC?
A Wi-Fi adapter would act as a wireless network card for a PC, and should communicate wirelessly with an AirPort Express base station without a problem (providing that the chosen security/encryption is supported on both sides). Since the wireless adapter apparently was OK (with the Linksys router), you should be able to continue using it. Any other (built-in) wireless capability ought to be externally visible at the PC as a PCI card with an antenna.
Does the (Windows?) PC operating system detect any wireless networks? Is your AirPort Express on this list (even if you cannot connect or access the Internet)?
Jan -
How to get connected to OIPM from Oracle WebCenter Document Capture
Hi,
How we get connected from Oracle WebCenter Document Capture(ODC) to Oracle WebCenter Cintent:Imaging (OIPM). OIPM is 11g and ODC is 10g. Pls suggest any doc or link.
Thanks and Warm Regards,
RR.Reading your previous question once again, now I think you have actually asked a simpler question than I answered to. Is it that you just need to anyhow send data from ODC to IPM?
If so, it is a standard functionality of ODC, called Commit Profile. I have never worked with IPM, but there is one to UCM and it works the way that you use administrator's login (such as sysadmin in 10g or weblogic in 11g) for authentication and then you map ODC user to a metadata field (in UCM there is a mandatory field called dDocAuthor and there should be value of an existing user; but you can you the administrator here as well, if ODC user info is not important for you). I believe IPM will behave similar.
What you have to check, whether commit profiles are available for IPM 11g, but I believe they are.
As for the documentation, the link I mentioned before contains both installation and configuration manual, so you should find all the info there. -
How to get acknowlgmnt from EFT (debt card swap) machine from swing app.
Hi,
Please some 1 let me know how to get acknowlegdement from EFT ( debit card Swap) machine once it is connected to the computer.
I have a code which seems to have no errors ut it I am not sure whether the EFT machine will be able to send or recieve the data once the car is swaped. because i dont know what is the response of the EFT machine when connected to the computer though a java swing class.
I know it will be quite tidious job for you to go through my program but this is all i can do...or atleast give me a link where i can refer to such case.......I am using eclipe Ide....and have searched alot on google too......Vish_1x1 wrote:
Hi,
Please some 1 let me know how to get acknowlegdement from EFT ( debit card Swap) machine once it is connected to the computer.What do you mean by "acknowledgement"? You realise it needs some sort of authorising host in order to authorise, right?
I have a code which seems to have no errors ut it I am not sure whether the EFT machine will be able to send or recieve the data once the car is swaped. because i dont know what is the response of the EFT machine when connected to the computer though a java swing class.Mumbo-jumbo
I know it will be quite tidious job for you to go through my program but this is all i can do...or atleast give me a link where i can refer to such case.......I am using eclipe Ide....and have searched alot on google too......Where did you get this "EFT machine" (whatever that is)? Do you mean a card reader? An EMV terminal? A PDQ? What? Where did it come from? Start there. If you need to get this thing working, you must be part of an enterprise, which has access to resources such as hardware vendor support, merchant banking services and EFT software vendors. If you're not, then you might as well abandon all hope of using this machine to take cards on your own, because you can't. End of story
And, no, nothing to do with Java -
How to get BOOLEAN from STORED FUNCTION
We are calling legacy PLSQL stored procedures and functions via named queries. This has worked fine so far, but there are some functions which return the type 'BOOLEAN'. e.g.
FUNCTION some_function( some_argument IN NUMBER) RETURN BOOLEAN;
Where the return type is BOOLEAN calling the named query fails with
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
A couple of threads have hinted that what we are trying to do is not possible:
How to get BOOLEAN from STORED PROCEDURES
Re: Creating Named Query: from OracleCallableStatement
This would possibly be due to 'restriction in the OCI layer'. Can anyone help? Is there really now way to call a valid PLSQL stored function via a named query when the return type is BOOLEAN?
thanksI can't comment on possible issues you might have with the driver, but if it can be done in JDBC, it should be possible in TopLink.
TopLink has the StoredFunctionCall which extends the StoredProcedureCall but adds an unnamed ouput parameter in the first spot of its parameter list. You will need to get the databasefield and set its type to BOOLEAN ie:
DatabaseField returnField = (DatabaseField)yourStoredFunctionCall.getParameters().firstElement();
returnField.setName(name);
returnField.setSqlType(Type.BOOLEAN);Be sure not to use the setType() method, as I believe TopLink will try to use the Type.BIT when a boolean class is used as the classtype.
Best Regards,
Chris -
Hi,
Just wondering, how to get answer from forum. Some time, for simple question, I don't see anybody replying.
Is there any other platform we get define answer or is there any support who can connect to our system suggest resolution?
Thanks,
-Anandanand_gp wrote:
Just wondering, how to get answer from forum. Some time, for simple question, I don't see anybody replying.
If it's really a simple question, then most people probably think the poster can get the answer from the documentation, or by searching the forum for previous answers.
However, most of the time, it's not that the question actually is simple. It's usually a question that is being asked simplistically, making it nearly impossible to answer (or often even understand). To get an effective response to a question, it needs to be the right question, asked in the right way.
Describe the the problem/requirement (not the attempted solutions) in detail:
How to ask questions
Re: 2. How do I ask a question on the forums?
Include as much relevant information with the question as possible, starting with:
APEX version
DB version, edition and host OS
Web server architecture (EPG, OHS or APEX listener), server platform, and host OS
Browser(s)/version(s) used
UI/Theme
Templates
Region type (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. To get a detailed answer then it's appropriate for the questioner to take on a significant part of the effort by reproducing the problem on apex.oracle.com before asking for assistance with specific issues, which can then be seen at first hand in a real APEX environment. -
How to get pictures from computer to iphone
how to get pictures from computer to i phone 4s
Sync them as you would anything else.
Open itunes, connect iphone, select what you want, sync. -
How to get photos from pc to iphone ?
how to get photos from pc to iphone?
1. Connect your iDevice to your computer with the USB connector. Open iTunes and select your device from the left sidebar. Then, select the photos tab from the top menu.
2. Organize and sync.
First choose where you’d like to sync your photos from. I use iPhoto, but you can use any photo management system.
Check the box next to each album &/or event you’d like to sync.
Alternatively, you could put all the photos you want to transfer into a separate folder on your computer, and choose to sync just that folder from the drop down menu.
Notice that I’ve checked the box “Include videos” so any included videos will also sync.
When your selections are made, click “Apply” and the photos will sync to the photo library on your device. -
How to get CLOB from stored procedure via StoredProcedureCall
hi all
I got "sp" on server : procedure get_text(p_in in varchar2, o_list out clob);
in code:
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("get_text");
call.addNamedArgumentValue("p_in", new String("MyList"));
call.addNamedOutputArgument("o_list"); // <- out CLOB
Vector v = (Vector)this.m_UnitOfWorkt.executeSelectingCall( call ); // <- here I got error
but if o_list is varchar is all ok
so how to get data from clob?
Please help
Regards
KrzysztofPost Author: achaithanya
CA Forum: Data Connectivity and SQL
I'm connecting to database through stored procedure only.We have sybase installed on our local system so that we are given permissions only to access the stored procedures.When u see the fields in CR XI i.e Field explorer you are able to see only 1st result fileds.I connected to sybase and there i'm able to see the output of 1st & 2nd Result set.
Regards,
Chaithanya. -
Get Connection from connection pooling
Hi,
I am aware of the fact that to get connection from a connection pool we need to add JNDI name in context.xml of apache tomcat and use it in our application to get connection. I have tested this and it works fine.
Now, we have 12 servers having free database each having almost 20 small Java applications for different purposes (get data from server database do some business logic and maipulation with data from central database and store on central database) each connecting to central database.
We were enjoying life till we had almost 8-9 servers but now many times we have connection issues as there are too many connections to central database and servers are going to increase.
I know my company design is not good but we need some solution.
I want my Java applications to take database connectivity using connection pooling on servers. My Java applications are standalone applications that do not run in web server. Is this approach fine?
I searched google for some solution but was unable to find.
Any pointers would be really helpful.
I think that since my application is outside web container I am unable to get Context (java:/comp/env). Please give me some pointers on how can i get web server context outside web server.
Thanks and Regards,
Vikash Anand.Google ( [jndi standalone application|http://www.google.com/search?q=jndi+standalone+application] ).
-
Weblogic realm authentication failure getting connection from pool
We are getting this error when we try to get a connection from the
pool for a Tx Data Source. We are successfully getting connections
from a (non-Tx) Data Source.
java.lang.SecurityException: Authentication for user Fitness_demo
denied in realm weblogic
at weblogic.security.acl.Realm.authenticate(Realm.java:212)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:125)
at weblogic.security.acl.Security.doAsPrivileged(Security.java:481)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:127)
We have added the DB user as a user in the realm, which usually does
the trick; but in this case it does not. We are using Merant's
JSQLConnect type 2 driver for SQL Server, and we are running on
Solaris. The scenario works fine using Oracle Thin driver on Windows.
Do we need ACL entries or something? We do not have any ACL entries
now.
Thanks,
-wesWe are getting this error when we try to get a connection from the
pool for a Tx Data Source. We are successfully getting connections
from a (non-Tx) Data Source.
java.lang.SecurityException: Authentication for user Fitness_demo
denied in realm weblogic
at weblogic.security.acl.Realm.authenticate(Realm.java:212)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:125)
at weblogic.security.acl.Security.doAsPrivileged(Security.java:481)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:127)
We have added the DB user as a user in the realm, which usually does
the trick; but in this case it does not. We are using Merant's
JSQLConnect type 2 driver for SQL Server, and we are running on
Solaris. The scenario works fine using Oracle Thin driver on Windows.
Do we need ACL entries or something? We do not have any ACL entries
now.
Thanks,
-wes -
Open script cannot get connection from the brower helper after 15 seconds.
Error:
===
Open script cannot get connection from the brower helper after 15 seconds. Do you want to continue waiting for the browser to load?
Please Note:
========
1. I have tried this only on IE
2. I am running OATS on a Remote desktop
Situation:
======
Trying to stop the recording
Try to get xpath of an object using Inspect Path
Setup details
========
Windows XP 5.1 Service Pack 3, x86
OpenScript 12.1.0.1.383
Internet Explorer 8.0.6001.18702
FireFox 13.0.1
Mitigation steps done till now:
==================
1. Disabled windows firewall
2. Disable XSS filter setting
3. Restarted the ATS services (3 of them)
4. Run the Open Script Diagnosis Tool (PS: There are 3 errros even after running it. The 3 errros are listed in the workspace_log log file snippet below...)
Error in worspace_log:
=============
To Change setting:
Go to Tools > Internet Options and Choose Security Tab
Select the Zone to modify and Press Custom level
Find Enable XSS filter Setting - Select Disable and click Ok
!ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
!MESSAGE Failure found when diagnosing Oracle EBS/Forms Load Testing Forms LT Diagnoser
!ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
!MESSAGE Did not auto-fix the problem.
!ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
!MESSAGE Suggestion for fixing: Please change your Java proxy setting to Use Browser Settings
Aprreciate help on this.To resolve this, you need to reconfigure the "Oracle Application Testing Suite Helper Service" (OATSHelperSvr) to start as a user who has privledges to run open script tests rather than the default SYSTEM user.
Reconfiguring the OATSHelperSvr Service:
1. Open the services panel (Start > Run > services.msc)
2. Find the Oracle Application Testing Suite Helper Service
3. Right Click > Properties then select the Log On Tab
4. Specify an interactive user that has rights to run OpenScript (test by logging in as that user and running tests):
5. Click OK
6. Restart the service after dialogs are closed by Right Click > Restart
7. You should now repeat this process for the "Oracle Application Testing Suite Agent Service" (eLoadAgentMon) Service (Two services in
total)
You should now retry running the test in Oracle Test Manager -
how to get photos from mac to iPhone 6? when i try it just comes up iCloud instead of my photos
Make sure Settings > iCloud > Photos > iCloud Photo Library (Beta) = "Off"
Then sync your iPhone using iTunes and make sure your sync settings for photos are set correctly in iTunes. -
I got a new computer and don't know how to get music from ipod touch to itunes library
I recently got a new computer and don't know how to get music from my ipod touch to show on my itunes library.
You need to transfer the iTunes folder from the old computer to the new one.
iTunes: How to move your music to a new computer (Mac or Windows):
http://support.apple.com/kb/HT4527 -
I have a new MacBook Air and don't know how to get info from my USB stick and get info from my SD card. Can anyone help, please?
Plug the stick and/or card into the appropriate slots on the side of your Air. Do you see icons for the devices appear on the desktop? Click into them to see what files are there.
Matt
Maybe you are looking for
-
Hi. I've had this unibody Mac Mini for a while, but over the last few months it has been very slow to repond - to clicks, app launches, everything. Almost all menu clicks take 3 seconds to react, and sometimes incur pinwheeling for up to a minute. So
-
ByteArray like FC64 Sample Application?
Hello dear developers, Did you know about FC64 Flash Application? Check out: http://codeazur.com.br/stuff/fc64_final/ It is a nice way for Flash Application can call into Binary. Is it possible with Linux Kernel? like CoLinux or Ulteo Desktop on Wind
-
TS4006 how can i find my stolen imac i do have cloud id
how can i find my stolen imac ? i do have cloud id.
-
OWB and Stage/Target Schema Options?
OWB and Stage/Target Schema Options? ========================= Thanks for your replies. As we know that we need to have Landing, Staging and Target (Data Warehouse) areas in ETL process. We are able to configure in multiple ways in OWB. Option 1 Keep
-
PLEASE HELP!... I am seriously freaking out... I use my Toolbar all the time!... and ALL OF MY BOOKMARKS ARE GONE ALSO!