TopLink Access Synonyms

Hi
I hava an application that is using TopLink, ADF and JSF. I hava an schema and mappings to that schema, and everything is working right. Now i need to access objects from another schema wich i have access to through synonyms
How can i do this ??
thanks a lot

I'm having trouble reproducing the issue you're seeing.
I started with our test database, which includes ADDRESS and EMPLOYEE tables related by a foreign key constraint. I have created synonyms for both ADDRESS and EMPLOYEE. I then started the Jave Objects from Tables wizard (Business Tier > TopLink).
On page 2 of 4 (select tables), I selected the synonyms that I had created. I accepted all defaults from there, and completed the wizard.
My TopLink Map didn't contain any mapping errors. The relationship mappings between my descriptors looked fine, and it picked up the PK information from the underlying tables.
I opened the editor for my descriptors (by double clicking "AddressSynonym" for example, in the structure pane), and I see a complete listing of my columns under primary keys.
Is your test case different from what I've tried?
Thanks,
-Billy

Similar Messages

  • Accessing synonym tables with jdbc

    accessing synonym tables with oracle jdbc driver 9i
    hi
    i'm having a problem selecting, updating, inserting and retrieving metadata from synonym tables.
    simple example is selecting from a table that is a synonym, i receive ORA-00942 table or view does not exist.
    is there any way to access synonym tables using the oracle jdbc driver?
    any help would be most appreciated.
    thanks
    Takis

    Hi Mirco,
    you can create your own function module to read TOA01 table and call this function module. It is a 5 minutes job of your ABAP programmer.
    To read list of BAPIs existing in your system call transaction BAPI.
    Generally there is no reason to read SAP tables. Think about 15.000 - 20.000 tables of standard SAP Web AS. No one is able to give you data model. You have to use business objects and their methods.
    Jiri

  • Invalid Number Error on Toplink Access

    I am wondering if anyone else has had this problem. Every time i query the database, i get this exception. I have already verified the Mapping documents. I have also attached, below, the toplink - generated JDBC call that is actually getting executed.
    --Connection(32185778)
    --SELECT QUERY_CASES_BY, QUERY_ID, CREATE_DATE, QUERY_NAME, DESCRIPTION, SHOW_DIAL_HOMES_F, END_DATE, LAST_UPDATED_BY, CREATED_BY, LAST_UPDATE_DATE, CASE_CONTACT_F, USER_ID, DURATION_DAYS FROM ESERV_USER_SAVED_QUERY WHERE (((((((((LAST_UPDATED_BY = ?) AND (CREATED_BY = ?)) AND (QUERY_NAME = ?)) AND (SHOW_DIAL_HOMES_F = ?)) AND (CASE_CONTACT_F = ?)) AND (USER_ID = ?)) AND (QUERY_CASES_BY = ?)) AND (DURATION_DAYS = ?)) AND (DESCRIPTION = ?))
         bind => [1, 1, test, true, true, 1, 100, 100, test]

    James,
    What data did you enter in each field? Could it be as simple as you tried to enter character data into the deptno column?
    Sergio

  • Accessing DB synonyms from BPEL - DB Adapter

    Hi Gurus
    I have problem accessing synonyms from BPEL. I am using DB Adapter. SOA Version is 10.1.3.3.0
    Schema1: Has procedure with input and output as Table object type.
    Schema2 : Has synonyms for above procedure and its input/output Table object type. We given execute grants to both procedure and its objects.
    Now from BPEL I am connecting to Schema2 and I am getting following error.But if above procedure has noraml primitive types as input/output It works correctly !
    Do BPEL - DB Adapter has problem accessing synonyms for procedure which has Table object type. ??
    file:/apps/SRODEV/product/AS10gR3_BPEL/bpel/domains/sro_domain/tmp/.bpel_EA_SR_ALLI_Pooler_1.0_598d1419bac8017f14f8adb156705b2b.tmp/GetContrlABCDataUsingDBProc.wsdl [ GetContrlABCDataUsingDBProc_ptt::GetContrlABCDataUsingDBProc(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'GetContrlABCDataUsingDBProc' failed due to: Error while converting from a Java struct object.
    Unable to convert a user defined type whose type name is XXEA_DRO_ABCS_CONTROL_OBJ_TYPE to XML corresponding to the definition of element P_ABCS_CONTROL_OBJ in the XSD. Cause: java.sql.SQLException: ORA-01436: CONNECT BY loop in user data
    [Caused by: ORA-01436: CONNECT BY loop in user data
    ; nested exception is:
    ORABPEL-11806
    Error while converting from a Java struct object.
    Unable to convert a user defined type whose type name is XXEA_DRO_ABCS_CONTROL_OBJ_TYPE to XML corresponding to the definition of element P_ABCS_CONTROL_OBJ in the XSD. Cause: java.sql.SQLException: ORA-01436: CONNECT BY loop in user data
    [Caused by: ORA-01436: CONNECT BY loop in user data
    Check to ensure that the struct definition in the XSD accurately describes the user defined type stored in the database. Contact oracle support if error is not fixable.

    Resolved.
    We need to prefix the object type with schema1 in all XSDs.
    For example,
    <element name="P_SR_OBJ_O" type="db:XXCTS_SRM_SR_OBJ_TYPE" db:index="5" db:type="Struct" minOccurs="0" nillable="true"/>
    TO
    <element name="P_SR_OBJ_O" type="db:*schema1*.XXCTS_SRM_SR_OBJ_TYPE" db:index="5" db:type="Struct" minOccurs="0" nillable="true"/>
    Make sure all occurrence are prefixed.
    Thanks
    /Mishit

  • How toplink grant permission for direct field access

    I know already know that if I need to direct access private or protected field of an instance I must grant supressAccessChecks to ReflectPermission class using policytool or edit java.policy file directly ...
    but how Toplink grant this permission to ReflectPermission class since my java.policy file remain the original.
    Kowit Laison

    In my own experiences, the first release of JDK 1.2 had problems with reflection accessing private attributes. As you mentioned, you had to have a policy file that allowed TopLink access to reflectively access private attributes.
    Since subsequent releases (1.2.x, 1.3, 1.4, etc), it always has "just worked". I.e., it seems to be default behavior of JVM's that you can acess private attributes through reflection. Sometimes some app servers come with startup scripts that have policies that change this default behavior and you have to override it, but in general, a vanilla JVM simply will allow private attribute access through reflection.
    - Don

  • Error transaction no longer active, no further JDBC access allowed

    Hello
    Our application uses WLS 6.0 SP2, TopLink 3.5.3, WebLogic JMS. A
    (pooled) JMS driven message bean invokes other application components
    (stateless session beans). Also, application components use JMS to send
    messages. JMS and application (through TopLink) use the same JDBC
    connection pool. TopLink connects through javax.sql.DataSource and
    external transaction controller. 2PC transactions are required to
    integrate JMS and TopLink DB access (see data source definition below).
    All components run in a single JVM, there is not distributed transaction
    between JVMs.
    When pushing > 5 concurrent messages into the system I get an error that
    somehow indicates TopLink access to a connection that is no longer
    associated with a WebLogic transaction.
    I can consistently reproduce this error with the Oracle thin, Oracle OCI
    and WebLogic OCI JDBC drivers. It seems to occur independent from the
    maximum number of connections in the pool (tested between 1 and 30).
    Also, when serializing the message supply with a pause in between the
    error does not seem to occur.
    Has anybody seen this type of problem before?
    Are there possibly known issues with the external transaction controller
    integration?
    Any help greatly appreciated.
    Thanks,
    Thomas
    EXCEPTION [TOPLINK-4002] (3.5.3 JDK1.2):
    TOPLink.Public.Exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: The transaction is no
    longer active (status = Committing). No further JDBC access is allowed
    within this transaction.
    INTERNAL EXCEPTION: java.sql.SQLException: The transaction is no longer
    active (status = Committing). No further JDBC access is allowed within
    this transaction.
    ERROR CODE: 0
    ### WebLogic config.xml ###
    <JDBCConnectionPool CapacityIncrement="1"
    DriverName="oracle.jdbc.driver.OracleDriver" InitialCapacity="1"
    MaxCapacity="15" Name="oraclePool"
    Properties="user=wlpi20;password=wlpi20;dll=ocijdbc8;protocol=thin"
    Targets="appserver"
    URL="jdbc:oracle:thin:@10.3.209.35:1521:wcdevdb"/>
    <JDBCTxDataSource EnableTwoPhaseCommit="true"
    JNDIName="com.bea.wlpi.TXDataSource" Name="TXDataSource"
    PoolName="oraclePool" Targets="appserver"/>
    <JMSJDBCStore ConnectionPool="oraclePool" Name="oraclePool"/>
    ### TopLink session/login setup for external transaction controller ###
    DatabaseLogin login = project.getLogin();
    login.setConnector(new TOPLink.Public.JNDI.JNDIConnector(
    initialContext, jdbcDataSource));
    login.setUserName(jdbcUser);
    login.setPassword(jdbcPasswd);
    ServerSession session = new ServerSession(project);
    login.useExternalConnectionPooling();
    login.useExternalTransactionController();
    final String tmname = "weblogic/transaction/TransactionManager";
    javax.transaction.TransactionManager transMgr =
    (javax.transaction.TransactionManager)
    initialContext.lookup(tmname);
    JTSSynchronizationListener.setTransactionManager(transMgr);
    session.setExternalTransactionController(
    new TOPLink.Public.JTS.JTSExternalTransactionController());
    logger.fine("registered external transaction controller");

    Better to ask on a hibernate forum, but you seem to
    be trying to reuse a closed transaction. If you have
    auto-commit set to ttrue, try changing it to false,
    the explicitly calling commit when you are done.Might be worth finding out why something is trying to use a closed transaction first, before changing your entire transaction management idiom, though

  • Building a form based on a synonym that points to a database link

    Hello
    Finally I got APEX 3 installed on our test server. I am starting to work with it and I faced my first problem...
    I need to build an application that will query and maintain data stored in another database server. This is because we were not allowed to install APEX in the production server. So I created a schema DEV_USER (which I associated with the workspace). In this schema I created a private database link my_link and a synonym:
    create synonym the_table for the_table@my_link
    I am trying to create a form to query and maintain that table via the synonym but I am not succeeding. The wizard does not work as the synonym is not listed in the table list. Then I created the form manually, creating the items, the Automatic Row Processing process etc. When I run the page I get the error Error ORA-01403: no data found.
    Is it possible to use APEX in this scenario (accessing synonyms that point to database links)? What is the recommended approach in this case?
    Thanks
    Luis

    Hi Kathryn
    Thanks very much for your reply. I did as you suggested; I dropped the synonym and created a view:
    create view my_table as select * from my_table@my_dblink
    ...and was able to create a multirow form based on that view.
    However, when I try to update any value on the form, I get the following error when submitting it:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01461: can bind a LONG value only for insert into a LONG column ORA-02063: preceding line from DB_LINK, update "APEX_DEV"."MY_TABLE" set "CAMPAIGN_ID" = :b1, "SITE" = :b2, "PERCENTUAL" = :b3, "DURATION_MONTHS" = :b4, "PRG_ID" = :b5, "AFF_ID" = :b6 where "CAMPAIGN_ID" = :p_pk_col and "SITE" = :p_pk_col2
    I thought it was because the form was based on a view; so I dropped the view and re-created the synonym (using the same name). When I tried to submit the updates again I got this error:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 0, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "35636E5FDD251146DB4B7B56119E7914", item checksum = "A884FA378C851786DDFE3A33709CB23C"., update "APEX_DEV"."MY_TABLE" set
    If you or anyone else could point out what I am missing, and maybe explain what those messages mean, it would be great!
    Thanks
    Luis

  • EJB 3.0 - problem reading request parameters

    I'm looking at Spring and TopLink integration and deploying with the EJB 3.0 version. I ran into problems when trying to retrieve a parameter from a request. Since I could not see anything wrong, I deployed with Tomcat and the code executed correctly.
    The simple case below illustrates the problem:
    <%@ page session="false"%>
    <%@ taglib uri="http://jakarta.apache.org/taglibs/request-1.0" prefix="req" %>
    <html>
    <head>
    <title>PetClinic :: a Spring Framework demonstration</title>
    </head>
    <body>
    The ID parameter is: <req:parameter name="id"/>
    </body>
    </html>
    Running with http://localhost:8080/sto12/welcomeURL.htm?id=foo causes foo to be displayed in Tomcat but not in OC4J EJB 3.0. Why is this?
    Thanks
    Mike

    Sorry, I tried to submit the problem in a simplified form and I can see I've just made it more confusing. Let me try again.
    Spring ships with a Petclinic sample. The Spring Toplink integration work has provided new classes that allow the Petclinic example to be deployed using Toplink as the object relational mapping. I have it running using Tomcat, but have had problems using OC4J EJB 3.0.
    In the sample app, there is a JSP that allows surname to be entered, which then calls code to search for Owners with a match on surname. That code treats no matches, one match and many matches differently.
    In the case of no matches, the JSP simply displays a message saying no matches found. In the case of many matches, it uses another JSP to display a list of Owners, from which the desired one is selected. The selected one is then displayed by a further JSP on which updates can be made. Where only one match with surname is found, the selection JSP is bypassed.
    Behind the scenes when obtaining the list of matching Owners, the Toplink code simply obtains a list. When one is selected, a further Toplink access is used which returns the selected Owner by reading via the primary key selected from the list. The essence of the problem is that there is a single piece of code in the sample that makes the Toplink call to read by primary key. When called in one scenario, it works, in the other it does not.
    Where that code is invoked as a result of the user selecting from a list, it is the JSP POSTing the selected Owner that transmits the primary key to the code. The code obtains the key from the request and everything works fine.
    Where only one Owner is found, a redirect is done with the key added as a parameter. When the same code as above attempts the retrieve the key, it is unable to do so ie it returns null and the subsequent Toplink call fails.
    Since the above obscures the problem, I played around with two of the JSPs provided - welcome.jsp and index.jsp. In the sample, index.jsp is included in the web.xml under <welcome-file-list> and hence is used when the app is started. It simply redirects to welcome.jsp. (I believe the reason is that all requests go via the Spring DispatcherServlet and are forwarded to the appropriate JSP depending on configuration - hence the comment that they are "virtual").
    When I put code in the index.jsp to display an id parameter and start it with an id provided, it displays the id parameter. When I let the index.jsp simply redirect to welcome.jsp (with an id included and welcome.jsp changed to display the value)it does not display the value.
    I'm sorry this has become a long post. The gist seems to be that I can't extract parameters from requests that have been redirected. As I said at the top of this note, this is not the case with Tomcat - I can run the same code there and retrieve parameters from a request, whether it has been redirected or not. I've posted in this forum because I believe the problem is with OC4J not with Spring or Toplink. I could be wrong.
    Any suggestions are very welcome.
    Mike

  • JBO-28006. Error message parameters are {0=PS_TXN_seq}

    When we run ADF program then error message display in log file.
    reproduce step is below.>>
    1.Create user sales_user, sales_runuser
    2.create db object in sales_user
    3.grant select, insert, update, delete on object to sales_runuser
    4.deploy ADF program
    5.run ADF program in sales_runuser
    6.check log
    Error Message is below.>>
    cause error code is JBO-28006. Error message parameters are {0=PS_TXN_seq}
    at oracle.jbo.PCollException.throwException(PCollException.java:36)
    at oracle.jbo.pcoll.OraclePersistManager.createTable(OraclePersistManager.java:889)
    at oracle.jbo.pcoll.OraclePersistManager.queryNextCollectionId(OraclePersistManager.java:1424)
    Caused By: java.sql.SQLSyntaxErrorException: ORA-01031: Insufficient Privilege
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
    I already research this reason and I found note.
    ORA-01031: insufficient privileges JBO-28006: Could not create persistence table PS_TXN_seq [ID 1245894.1]
    This Note's solution - add privileges (create table, create index, create sequence) to sales_runuser.
    sales_runuser is ADF runtime user.
    But we already have database object (ps_txn, ps_txn_seq) in sales_user.
    sales_user is database object owner.
    Our DBA don't want to add privileges (create table, create index, create sequence) to sales_runuser.
    SO we tried grant db object and created synonym.
    Script is below.>>
    1.connect sales_ser
    2.grant all on ps_txn, ps_txn_seq.
    3.create synonym sales_runuser.ps_txn, sales_runuser.ps_txn_seq for sales_user.ps_txn, sales_user.ps_txn_seq.
    restart Middleware Server.
    But Error message still display.
    We want to access synonym in ADF run user.
    Is it possible or impossible?
    Pls, Let me know correct answer.

    You can set the configuration property jbo.server.internal_connection to direct the state management to use a different database connection than your application. Maybe this helps?
    Documentation: http://docs.oracle.com/cd/E12839_01/web.1111/b31974/bcstatemgmt.htm#ADFFD1307
    - Joonas

  • Data retrieval after EM closed, bug?

    Hello.
    I think TopLink is retrieving data after EM has been closed in the case
    below, and I'm not sure if this behavior is correct.
    CASE: (Steps 1 to 4 and follows)
    STEP 1.- I'm using a recursive table (most probably the same applies for
    non-recursive tables):
    create table "SA"."RECURSIVA" (
    PK int primary key not null,
    DATO varchar(10),
    PADRE int references RECURSIVA
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (0,'Raiz',null);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (1,'n1',0);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (2,'n2',1);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (3,'n3',2);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (4,'n4',3);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (5,'n5',4);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (6,'n6',5);
    INSERT INTO "SA"."RECURSIVA" (PK,DATO,PADRE) VALUES (7,'n7',6);
    STEP 2.- This is the entity (please note+ the LAZY fetch type):
    @Entity
    @Table(name = "RECURSIVA")
    public class Recursiva implements Serializable {
    @Id
    @Column(name = "PK", nullable = false)
    private Integer pk;
    @Column(name = "DATO")
    private String dato;
    @OneToMany(mappedBy = "padre")
    private Collection<Recursiva> recursivaCollection;
    @JoinColumn(name = "PADRE", referencedColumnName = "PK")
    @ManyToOne(fetch=FetchType.LAZY)
    private Recursiva padre;
    STEP 3.- This is the data retrieval code (please note+ EntityManager is closed
    before accesing data):
    EntityManagerFactory emf =
    Persistence.createEntityManagerFactory("mijpa");;
    EntityManager em = emf.createEntityManager();
    Recursiva rc = null;
    rc = em.find(Recursiva.class, 7);
    em.close();
    while (rc != null) {
    System.out.println(rc.getDato());
    rc = rc.getPadre();
    emf.close();
    STEP 4.- Results:
    n7
    n6
    n5
    n4
    n3
    n2
    n1
    Raiz
    QUESTIONS: If em is closed right after the leaf entity is retrieved:
    A. How is it possible that all of the leaf ancestors up to the root are
    retrieved?
    B. Is toplink accessing the database after em is closed or simply the
    full hierarchy is eagerly loaded at the very beginning?
    C. Is this correct, or is it a bug?
    NOTE: openjpa prints n7 and n6, as I would have expected.
    I would appreciate your comments, specially if you think this is a bug,
    in order to report it.
    Thanks.
    Antonio.
    Tested with:
    * [Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))]
    * [derby 10.4.1.3]
    * [java hotspot 1.6.0_06-b02]
    * [ubuntu 8.04.1 2.6.24-19-generic]

    Issued as
    https://glassfish.dev.java.net/issues/show_bug.cgi?id=5782

  • Architecture Sanity Check

    I'm just getting started with TopLink and need some architectural advice. My TopLink project will be used by two different web applications that may or may not be hosted on the same server. The first application uses Jakarta Struts to create a web interface. The second uses Apache SOAP to provide a web service interface. Both applications use the same database.
    Given this, what is the best practice for using TopLink while taking into account concurrency issues? Do I need to use the Remote Sessions (RMI) approach?
    Thanks!

    Thomas,
    Remote Session is not the answer. It is used to get TopLink access from another tier. For multiple applications using the same project os multiple instances of the same project there are a couple of issues to address in your configuration of TopLink.
    1. Concurrency
    2. Stale Cache
    To address concurrency I would recommend using optimistic locking on all tables. This is typically done using a version field (numeric or timestamp) but can also be accomplished using some or all of the fields of the table. Refer to the docs for how to setup this feature. You will also need to ensure that each transaction also check for OptimisticLockingException.
    Dealing with the potential for stale cache is caused by multiple applications (including non-Java/legacy) modifying the same database. TopLink's cache can be configured on a per class basis. For reference/static data I would use a FullCacheWeakIdentityMap. For classes of data that may change more frequently you could use a SoftCacheWekaIdentityMap or to hold objects for the minimal amount of time a WeakIdentityMap.
    Additionally there are some settings that may be of interest.
    - query.refreshIdentyMapResult() - will force the refresh on a given query/finder.
    - descriptor.onlyRefreshIfNewerVersion() - makes use of optimistic locking field(s) to determine if refresh is required
    - Cache-Synchronization will allow changes made in one TopLink session (application instance) to be notified and updated in other sessions using the same project. This will minimize stale cache situations.
    Every application has a different profile for how to handle stale cache and TopLink offers a number of features that are easily and externally configurable. Ensuring that concurrency is addressed through locking is crucial then the configuration can be adjusted to minimize stale objects and optimize the performance benefits of the cache.
    Doug

  • Websphere 5.0 and non-jts-datasource = 2PC exception!

    Hello all
    We're migrating from a working weblogic 8 app to websphere 5.0, and we run into this problem.
    Toplink tries to enlist the NON-JTS datasource in the global transaction. In weblogic we defined our non-jts datasource as a non-transactional datasource, but there is no such option in websphere. What is going on??
    Please help
    TIA
    - Russ -

    Hello Rustam,
    WebSphere 5 throws exceptions when you try to get a non-jta datasource while in a transaction - it seems to try to enlist it in the transaction I think.
    This is more a WebSphere issue, since it means you cannot read outside of the transaction.
    There are 3 options:
    1) Don't define a non-jta datasource at all in TopLink. Draw backs to this are that there may be problems reading when there is no transaction, such as when you are using cache synch.
    2) Create your own datasource (outside of WebSphere) and place it in JNDI. Then have TopLink access it as a non-jta datasource. Your datasource must be completely independent of WebSphere so that it does not attempt to associate with JTA.
    3) Use a TopLink maintained read connetion pool. You can use the non-jts-connection-url sessions.xml tag, which will use the login setting defined in your project.xml. I've not tested it, but can also override the read pool in a preLogin event that should look something like:
    public void preLogin(SessionEvent event) {
    DatabaseLogin dbLogin(new Oracle9iPlatform());
    dbLogin.setUserName("name");
    dbLogin.setPassword("password");
    dbLogin.setConnectionString("jdbc:oracle:thin:@ip:port:sid");
    ConnectionPool readPool = new ReadConnectionPool("read", dbLogin, minCon, maxCon, event.getSession());
    event.getSession().setReadConnectionPool(readPool);
    Best Regards,
    Chris Delahunt

  • How can I access a database remote without using dblink, synonyms,aliases?

    My store procedure access a remote tables using dblink, synonyms, alias, but by business company requirenments I nedd to use another data base access method. My PL/SQL statement looks like
    select c.cus_id, c.cus_name, p.bankaccno
    into v_cus_id, v_cus_name, v_bankaccno
    from customer c, payment@finantial p
    where c.cus_id = p.cus_id
    Are any method else to connect to several remote databases concurrently?
    If Yes, plase say me how is it, or tell me where do I obtain some examples, or any documentation.
    Edited by: user518321 on Apr 21, 2009 1:58 PM
    Ok, But I must not use any of these data base access method, metioned: dbliks, aliases, synonyms.
    Edited by: user518321 on Apr 21, 2009 2:05 PM
    Ok, It is enough for now, I am surprised for the response time and for their arguments, thanks a lot.
    Edited by: user518321 on Apr 21, 2009 2:50 PM

    If you want to access a table in a remote database using SQL, you will need a database link. It would be exceptionally odd for the business to require that you access a remote database and to prohibit the use of database links. What is the business reason for that combination?
    If you want to look into rather more esoteric solutions, you could load a JDBC driver for the remote database, write a Java stored procedure that queries the remote table using that JDBC driver, and then cobble together some PL/SQL that joins the two result sets. You won't be able to reference the remote table in SQL and the solution won't scale well as data volumes increase and you'll be writing a whole lot of code to manually join tables together, but it does avoid database links. Of course, whatever concerns lead to the ban on database links would probably apply to loading a JDBC driver into the database and writing Java stored procedures to access the remote database, but since you haven't explained the reasoning behind the restrictions, we're just guessing.
    Justin

  • Could not create/access the TopLink Session.While invoking OSB proxy.

    Hi,
    While testing an OSB proxy ,which uses a multi datasource to connect to a remote database, from the sbconsole.I am getting exceptions and it is not able to create/access the TopLink Session.
    I have checked the multi datasource jndi name ,which is correct.
    The stack trace which I am getting while invoking the service is posted below:
    oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/CRN_CommonServices/SaveTransactionBSV2 [ SaveTransactionBSV2_ptt::SaveTransactionBSV2(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'SaveTransactionBSV2' failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    ; nested exception is:
    JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    See root exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart the server. Caused by javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:225)
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundBindingServiceImpl.invoke(JCATransportOutboundBindingServiceImpl.java:136)
    at com.bea.wli.sb.transports.jca.JCAOutboundMessageContext.sendRequestResponse(JCAOutboundMessageContext.java:152)
    at com.bea.wli.sb.transports.jca.JCAOutboundMessageContext.send(JCAOutboundMessageContext.java:113)
    at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:464)
    at sun.reflect.GeneratedMethodAccessor249.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:82)
    at $Proxy76.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:543)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:478)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:544)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:422)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:583)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatchSync(PipelineContextImpl.java:466)
    at stages.transform.runtime.WsCalloutRuntimeStep$WsCalloutDispatcher.dispatch(WsCalloutRuntimeStep.java:1401)
    at stages.transform.runtime.WsCalloutRuntimeStep.processMessage(WsCalloutRuntimeStep.java:236)
    at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
    at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
    at com.bea.wli.sb.pipeline.PipelineStage.processMessage(PipelineStage.java:84)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
    at com.bea.wli.sb.pipeline.Pipeline.processMessage(Pipeline.java:141)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
    at com.bea.wli.sb.pipeline.PipelineNode.doRequest(PipelineNode.java:55)
    at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
    at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:191)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:75)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:508)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:506)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:505)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:263)
    at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:68)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:125)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:123)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:128)
    at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:441)
    at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:169)
    at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:136)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(TestService_sqr59p_EOImpl.java:572)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/CRN_CommonServices/SaveTransactionBSV2 [ SaveTransactionBSV2_ptt::SaveTransactionBSV2(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'SaveTransactionBSV2' failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    ; nested exception is:
    JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    See root exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart the server. Caused by javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:619)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:331)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:220)
    ... 57 more
    Caused by: JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    See root exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart the server. Caused by javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
    at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:473)
    at oracle.tip.adapter.db.exceptions.DBResourceException.couldNotCreateTopLinkSessionException(DBResourceException.java:216)
    at oracle.tip.adapter.db.DBManagedConnectionFactory.acquireSession(DBManagedConnectionFactory.java:638)
    at oracle.tip.adapter.db.transaction.DBTransaction.getSession(DBTransaction.java:457)
    at oracle.tip.adapter.db.DBConnection.getSession(DBConnection.java:222)
    at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1001)
    at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:232)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:463)
    ... 59 more
    Caused by: javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
    at oracle.tip.adapter.db.exceptions.DBResourceException.missingPropertyException(DBResourceException.java:348)
    at oracle.tip.adapter.db.DBManagedConnectionFactory.createServerSession(DBManagedConnectionFactory.java:932)
    at oracle.tip.adapter.db.DBManagedConnectionFactory.acquireSession(DBManagedConnectionFactory.java:413)
    ... 64 more
    Looking forward for your help.
    Thanks a lot in advance.
    Sumit

    Have you created XA data source? If yes then make sure that in connection factory you are assigning the JNDI name of data-source in XAdataSource property (NOT in datasource property). Also make sure that your datasource is up and running and you are updating the dbadapter after creating connection factory.
    Regards,
    Anuj

  • Can't access User type using Synonyms/Grant

    Hi,
    We have a Stored Proc and it accepts a usertype. We are sending info from Java using JDBC and trying to get the results back. If I use the owner of the schema for connection it works fine. If I use a different schema user which has synonyms and grant access to the storeproc and userobject program does not work. Here is the stripped down code. If any one faced this problem please respond to [email protected].
    In the program I used QStore_user as user. QStore_user has Synonyms for USERTABLE, GET_NEXT_ID. Owner of these objects is QSTORE_OWNER. QSTORE_OWNER provided Grant 'Execute' to both of these for QSTORE_USER. If I change the java code to use QSTORE_OWNER it works fine.
    Java Sample Program
    ====================
    * This sample can be used to check the JDBC installation.
    * Just run it and provide the connect information.
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.jdbc.dbaccess.*;
    // We import java.io to be able to read from the command line
    import java.io.*;
    class JdbcArrayCheckup
    public static void main(String args[])
    throws SQLException, IOException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    System.out.print("Connecting to the database...");
    System.out.flush();
    System.out.println("Connecting...");
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@DKING-W2K:1521:WASDB", "qstore_user", "qstore_user");
    System.out.println("connected.");
    Object[] elements = {"Sasi","Mahesh","Deepak"};
    String currentName = "Sasi";
    ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("USERTABLE", conn);
         System.out.println("Got Array Descriptor");
         oracle.sql.ARRAY inp_array = new oracle.sql.ARRAY(arrayDesc,conn,elements);
         System.out.println("inp_array = " + inp_array);
    // Create a Callable statement
         CallableStatement callStmt = conn.prepareCall("{? = call GET_NEXT_ID(?,?)}");
         System.out.println("created callable statement");
         // Call setArray to set input array
         callStmt.setArray(2,inp_array);
         System.out.println("set Array done for User ID array");
         callStmt.setString(3,currentName);
         System.out.println("set String done for Policy ID");
         callStmt.registerOutParameter(1,Types.VARCHAR);
         System.out.println("registered out Parameters");
         // Execute the query
         ResultSet rset = callStmt.executeQuery();
         System.out.println("executed query");
         String userID = callStmt.getString(1);
         System.out.println("after getting next assigned ID = " + userID);
         // close the result set, the statement and connect
    rset.close();
    callStmt.close();
    conn.close();
    System.out.println("Your JDBC installation is correct.");
    Database Temp Function
    ======================
    function GET_NEXT_ID (input_userid_list USERTABLE,
         input_policy_id varchar2
    return VARCHAR2
         is
         counter NUMBER;
         return_user_id varchar2(30);
         /* UserTable is defined as follows -
         create or replace type usertable as table of varchar2(30);
         BEGIN
              for counter in 1..input_userid_list.COUNT LOOP
                   dbms_output.put_line('tempuser id = ' || input_userid_list(counter) );
              end loop;
              dbms_output.put_line('out of the loop');
              return_user_id := 'Mahesh';
              return return_user_id;
    END GET_NEXT_ID;
    DataType
    ===========
    create or replace type usertable as table of varchar2(30)
    Error
    =======
    Connecting to the database...Connecting...
    connected.
    Exception in thread "main" java.sql.SQLException: ORA-21700: object does not exi
    st or is marked for delete
    ORA-06512: at "SYS.DBMS_PICKLER", line 16
    ORA-06512: at "SYS.DBMS_PICKLER", line 52
    ORA-06512: at line 1
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java, Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java, Compiled Cod
    e)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
    va, Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
    a:1371)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
    nt.java:1900)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
    edStatement.java:363)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
    ement.java:407)
    at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:420
    at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:343)
    at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1002)
    at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:132)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:97)
    at JdbcArrayCheckup.main(JdbcArrayCheckup.java:36)
    press any key to exit...
    If you do not want this console to remain after the VM exits,
    clear the "Keep Executed App Console" setting in your Visual Cafe
    environment options
    Other INFo
    ===========
    Running select * from all_synonyms where table_owner = 'QSTORE_OWNER' under QSTORE_USER results in
    QSTORE_USER     USERTABLE     QSTORE_OWNER     USERTABLE     
    QSTORE_USER     GET_NEXT_ID     QSTORE_OWNER     GET_NEXT_ID     
    select * from all_tab_privs where table_schema = 'QSTORE_OWNER' under QSTORE_OWNER results in
    QSTORE_OWNER     QSTORE_USER     QSTORE_OWNER     GET_NEXT_ID     EXECUTE     NO
    QSTORE_OWNER     QSTORE_USER     QSTORE_OWNER     USERTABLE     EXECUTE     NO

    Might be possible that the usernmae & password you are using is not working on the route ... make sure that you are using correct username & password .... if not then reset the router so that the password also gets resetted & you can use Admin password without any username ...
    Once resetted you need to reconfigure the router ... .& open the port 8080 for remote access ....

Maybe you are looking for

  • Reg: Re-process Order

    Hi Friends, I am new to PP-PI. i want to know about re-processing the process order. i have created an new order type (Re-Work order type for Re-processing) .I saw few threads whioch explains we can do it through CORO transaction. At the time of crea

  • HT5622 Can I use two Apple ID account in one device.  Are there irregularities

    Can I use two Apple ID account in one device. Are there irregularities

  • Every time I try to add album artwork, itunes locks up

    I have tried a varity of ways to add artwork to itunes and no mater how I do it it itunes locks up and I have to turn the power off go get it started again. It looks like it is working OK. It puts the picture in the box, but itunes locks up and I can

  • Ipod headfone problem

    have a problem with my ipod nano, when i listen to music on it there is a very annoying buzzing sound from the left ear, its not the ear phones that are the problem i think it may be the ipod itself can anyone help ? or sugest how i could get it fixe

  • TS1702 I can't download any google apps.

    I can download and use any other app just fine. When I try to hit "install app" it just goes back to "free." How to I fix this? I have restarted it and nothing has worked.