[JPA] Query sent to a unactivated UnitOfWork.

Hi,
Does one of the TopLink Essentials mavens have a clue why we would get the following stack trace:
Exception [TOPLINK-6027] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.QueryException
Exception Description: Query sent to a unactivated UnitOfWork.
Query: ReadObjectQuery(xxx.xxxx.rose.model.entities.Tr01TaxpayerTin)
     at oracle.toplink.essentials.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:908)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2231)
     at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
     at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:101)
     at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:91)
     at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
     at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:175)
     at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:247)
     at oracle.toplink.essentials.internal.indirection.UnitOfWorkQueryValueHolder.setValue(UnitOfWorkQueryValueHolder.java:84)
     at xxx.xxxx.rose.model.entities.Ta01Declaration._toplink_settaxpayer(Ta01Declaration.java)
     at xxx.xxxx.rose.model.entities.Ta01Declaration.setTaxpayer(Ta01Declaration.java:1195)
     .It doesn't seem to have anything to do with us.
TopLink itself has modified the bytecodes for method setTaxpayer (which is a @ManyToOne(fetch=FetchType.LAZY) relationship) and has problems with it now.
Here's info about the relationship definition and the method:
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="CR01_TIN_ID", referencedColumnName="CR01_TIN_ID", nullable=false)
    private Tr01TaxpayerTin taxpayer;
    public void setTaxpayer(Tr01TaxpayerTin taxpayer) {
        this.taxpayer = taxpayer;
    }Best regards,
Bisser

All right, then. The following combination does the trick:
1. persist()
2. flush()
3. refresh()
4. rollback()
5. assign a value to the @ManyToOne relationship
BANG!  ("Query sent to a unactivated UnitOfWork.")With a commit() everything works ok. The rollback(), however, causes the exception.
Sample code, assuming that there's a @ManyToOne relationship between Customer and Company:
Customer.java:
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="COMPANY_ID", referencedColumnName="ID")
     private Company company;
     public Company getCompany() {
          return company;
     public void setCompany(Company company) {
          this.company = company;
     }The code to reproduce the error:
     Customer cust = new Customer();
     cust.setName("Jones");
     cust.setCompany(comp);
     em = emf.createEntityManager();
     em.getTransaction().begin();
     em.persist(cust);
     em.flush();
     em.refresh(cust);
     em.getTransaction().rollback();
     cust.setCompany(comp);    // B A N G ! ! ! ! ! ! ! !This also crashes with the latest version of TopLink Essentials -- Oracle TopLink Essentials - 2.1 (Build b60-fcs (11/17/2008)) -- that I downloaded from here: https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html
Which version do you use in EclipseLink? Or... is it even a version developed separately from the Glassfish version?

Similar Messages

  • Transparent indirection = Query sent to a unactivated UnitOfWork

    Hi,
    since we upgrade from version 7 to 10g, we have an intermittent error that occur only when accessing a collection that use transparent indirection. I'm loading a participant and I want all his addresses. The addresses collection use indirection so it's only load when it's needed. But when I try to access the addresses, I get this exception :
    Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(xxx.xxx.business.participant.Address)
         at oracle.toplink.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:816)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2576)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:62)
         at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:55)
         at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
         at oracle.toplink.indirection.IndirectList.buildDelegate(IndirectList.java:202)
         at oracle.toplink.indirection.IndirectList.getDelegate(IndirectList.java:359)
         at oracle.toplink.indirection.IndirectList$1.<init>(IndirectList.java:461)
         at oracle.toplink.indirection.IndirectList.iterator(IndirectList.java:460)
    The participant and all the other collection (not setup as transparent indirection) are loaded successfully. If I shut down the server, restart it and access the same participant, it work.
    I use the Session object to get the participant. When I successfully get the particpant, I close this session because I can't keep all session open for all the transparent indirection collection.
    We never had this problem before. Maybe something change in the management of the Toplink cache, session and indirection.
    Thank you.
    Andre

    I checked version 9 and this error seems to have always been thrown. There was no version 7 (we went from 4.5 to 9.0.3), so I'm not sure what your original version was? Are you current using 10.1.2 or 10.1.3?
    What seems to be occurring is you are unexpectedly getting a reference to an object from a UnitOfWork, instead of from the Session cache. This could be caused by your application incorrectly modifying original objects or not registering object correctly in a UnitOfWork, or from a merge issue.
    Nothing should have changed in TopLink's cache management or indirection. You may wish to try narrowing down how your application is getting a reference to a UnitOfWork clone. You can use,
    session.getIdentityMapAccessor().getFromIdentityMap(object)
    to get the cached version of an object, if your object is not identical to this, then it could be from a UnitOfWork.

  • Query sent to a unactivated UnitOfWork

    Hi,
    I've a bug on a application using TopLink 10.1.3.
    The exception occurs only when the cache (soft/weak) is enabled on the targeted objects.
    I've to descriptor named "Sv2Demande" and "Sv2Modification". "Sv2Demande" has a one-to-many relationship to "Sv2Modification" with transparent indirection.
    With the cache is activated (usual object caching - not the result caching) , if a update the "Sv2Demande" and then read it again, TopLink gives me an instance of "Sv2Demande" with a reference to the previous unit of work in its Inderection Object. So when I trigger the indirection using:
    mySv2Demande.getSv2Modification();The following exception occurs:
    Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(eu.curia.suivi2.model.Sv2Modification)
         at oracle.toplink.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:816)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2576)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:62)
         at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:55)
         at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
         at oracle.toplink.indirection.IndirectList.buildDelegate(IndirectList.java:202)
         at oracle.toplink.indirection.IndirectList.getDelegate(IndirectList.java:359)
         at oracle.toplink.indirection.IndirectList.size(IndirectList.java:703)
         at eu.curia.suivi2.datamanager.impl.DemandesDataManagerImpl.copyPropertiesFromDbToModelLight(DemandesDataManagerImpl.java:2039)
         at eu.curia.suivi2.datamanager.impl.DemandesDataManagerImpl.loadListeDemandesRecherche(DemandesDataManagerImpl.java:2794)
    I have checked and we don't keep the reference to Sv2Demande used by the UnitOfWork, we reload it using a ReadQuery in a common ServerSession.
    Any ideas?

    TopLink 10.1.3.0 is rather old and there have been a number of issues that might be related that have been since fixed. Try the latest version or at least the latest 10.1.3 patchset and see if it helps. If it does not, you may need to open a case with support to look into it further.
    Best Regards,
    Chris

  • General JPA query question

    Hello world,
    I'm new to JPA 2.0 and there are few things I don't understand.
    BTW: I can't figure out the keywords to search for this question, so please pardon me if it's one of the most asked.
    Using the Preview, I've seen that alignment went straight to Hell, so I tried to make this as readable as I could using pipes in place of white spaces in the result sets.
    I have a couple of tables:
    CUST table (for customers):
    CUST_ID (pk, integer)
    CUST_NAME (varchar)
    ORD table (for orders):
    ORD_ID (pk, integer)
    ORD_STATUS (char) can be: N for new, S for shipped, D for delivered
    CUST_ID (fk, integer)
    The relationship is, of course, a "one to many" (every customer can place many orders).
    Content of the tables:
    CUST_ID|CUST_NAME
    1|elcaro
    2|tfosorcim
    3|elppa
    ORD_ID|ORD_STATUS|CUST_ID
    2|N|1
    3|N|1
    4|N|1
    5|S|1
    6|S|1
    7|D|1
    8|D|1
    9|D|1
    10|D|2
    11|N|2
    12|S|3
    13|S|3
    Here's how I annotated my classes:
    Customer.java:
    @Entity(name = "Customer")
    @Table(name = "CUST")
    public class Customer implements Serializable
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "CUST_ID")
    private Integer id;
    @Column(name = "CUST_NAME")
    private String name;
    @OneToMany(mappedBy = "customer")
    private List<Order> orders;
    // Default constructor, getters and setters (no annotations on these)
    Order.java:
    @Entity(name = "Order")
    @Table(name = "ORD")
    public class Order implements Serializable
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "ORD_ID")
    private Integer id;
    @Column(name = "ORD_STATUS")
    private Character status;
    @ManyToOne
    @JoinColumns
    @JoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID")
    private Customer customer;
    // Default constructor, getters and setters (no annotations on these)
    Everything works just fine, the following JPQL query yields the results I expected:
    select c from Customer c
    it returns three objects of type Customer, each of which contains the orders that belong to that customer.
    But now, I want to extract the list of customers that have orders in status 'N', along with the associated orders (only the status 'N' orders, of course).
    Back in the good ol' days I would have written an SQL query like this:
    select c.cust_id, c.cust_name, o.ord_id, o.ord_status
    from cust c
    inner join ord o on (o.cust_id = c.cust_id)
    where o.ord_status = 'N'
    and it would have returned the following result set:
    CUST_ID|CUST_NAME|ORD_ID|ORD_STATUS
    1|elcaro|2|N
    1|elcaro|3|N
    1|elcaro|4|N
    2|tfosorcim|11|N
    The following JPQL query, however, doesn't yield the expected results:
    select distinct c from Customer c join c.orders o where o.status = 'N'
    it returns the correct set of customers (customer 'elppa' doesn't have any status 'N' order and is correctly excluded), but each customer contains the full set of orders, regardless of the status.
    It seems that the 'where' clause is only evaluated to determine which set of customers has to be extracted and then the persistence provider starts to navigate the relationship to extract the full set of orders.
    Thinking a little about it, I must admit that it makes sense.
    I then tried out another JPQL query:
    select c, o from Customer c join c.orders o where o.status = 'N'
    this JPA query yields results that are similar to the ones produced by the previous SQL query: each result (4 results as expected) is a 2-object array, the first object is of type Customer and the second object is of type Order. But, again, the objects of type Customer contain the full set of related orders (as I expected, this time). Not to mention the fact that now the orders are not contained in the Customer objects, but are returned separately, just as in an SQL result set.
    Now the question is:
    Is it possible to write a JPA query that filters out, not only the customers that don't have an order in status 'N', but the related orders (fetched during relationship navigation) that are not in status 'N' as well?
    What I'd like to be able to get is a 2-customer result where each customer contains only its status 'N' orders.
    I read the Java EE 6 Tutorial and one of the examples (the Order Application) has a schema that is similar to mine, but I couldn't find a query like this (in the downloaded source code).
    Although I think the above is standard behavior, I use an Oracle Weblogic 12c server (through its Eclipse adapter) and the persistence provider appears to be EclipseLink.
    Thanks in advance.
    Best regards,
    Stefano
    Edited by: user11265230 on 17-apr-2012 14.11

    Hello,
    When returning an entity from JPQL, it gives you the entity as it is in the database. Your "select distinct c from Customer c join c.orders o where o.status = 'N'" is asking for all customers that have an order with a status of 'N', so that is what it gives you. There is no condition to filter anything on the relationship when building the Customer object in JPA - doing so would mean returning a managed entity that does not reflect what is in the database. This would affect other queries, since JPA requires that queries return the same instance of an entity regardless of the query that is used to bring it back. So a query using your "where o.status = 'N'" would cause conflicting results when used with a query using "where o.status = 'Y'". And these queries would make the EntityManager unable to determine what has changed on the returned objects.
    EclipseLink does have the ability to filter over relationships, it is just not available through standard JPA and I would strongly discourage it. Instead of querying for Customers, why not change the query to get Orders instead -
    "select o from Customer c join c.orders o where o.status = 'N'". Assuming Orders have a ManyToOne back reference to their Customer, this will mean you do not need to travers the Customer-> order relationship. If using
    "select c, o from Customer c join c.orders o where o.status = 'N'"
    I am not sure why you would use the orders from the returned customers instead of the orders returned in the results though.
    You could also return "select c.id, c.name, o.id, o.status from Customer c join c.orders o where o.status = 'N'" which is the equivalent of what you would get from the SQL you initially posted.
    Regards,
    Chris

  • How to configure lazy/eager loading for each JPA query

    Hi!
    I have extensive EJB model (entities with many child entities, entities with association to other large (many fields, BLOBs including) entities, and so on) and I would like for each JPA query configure what properties or associated entities (actually - in arbitrary depth) of selected entities should be fetched.
    E.g. for one query I would like to fetch only Order (and no data of associated entities), but for other queries I would like to fetch Order, Order.Customer, Order.ShippingAddress.ZipCode and nothing else ( e.g. if there is Ordere.Route, Order.Billing and other associations, then I would like not to waste resources for fetching them). In both case the select clause of query can include only Order, but the results should be different - i.e. - there is no associated data in the first case and there are some associated data the second case.
    I know that one solution is to declare all associations as lazy and then - after reading the result of query - do some touching for retrieving the associated data:
    String check = order.Customer.toString();
    check = order.ShippingAddess.ZipCode.toString();
    But I see 2 problems with this: 1) it is not nice (resources are wasted for simply touching associated entities); 2) I assume that each "touch" operation generates other query to database that could be executed together with the original query. So - it would be nice to configure JPA query somehow to let it know which associations will be required from the result and which not.
    What is the best practice?
    I found, that JBoss server has lazy-loading-group configuration, but - I guess - it is JBoss specific:
    http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.2/html/Server_Configuration_Guide/Loading_Process-Lazy_loading_Process.html
    besides - it is XML and it would be more pretty if query configuration could be done with annotations!

    JPQL has a "fetch" construct in which you can force a lazy element to be fetched using a query - I must note that I have had unexpected results with it in the past but that was using an old version of Hibernate and I wasn't very experienced with JPA yet.
    http://docs.oracle.com/cd/E15051_01/wls/docs103/kodo/full/html/ejb3_langref.html#ejb3_langref_fetch_joins

  • JPA query language syntax

    My question is if JPA query language syntax allows full qualified class names in the SELECT clause of the query, e.g.:
    SELECT * FROM com.abc.Person
    This works well with Hibernate, but TopLink Essentials complains about the dots in com.abc.Person.
    In the Java EE 5 Tutorial only partially qualified names ( SELECT * FROM Person) are used.
    There are only examples with fully qualified names for constants in WHERE clauses.

    my first guess:
    SELECT t FROM tablename t WHERE t.timestamp>:somethingwhere :something
    is handled with something like: (..).setParameter("something", someSQLDate);

  • JPA Query set parameter list of objects

    Hi Experts,
    Currently i am looking for the resolution to the the following JPA Query. I am sure you guys already came across the answer for that. Please help me to spot some light.
    Assume a relation Employees --> Departments. I have list of department and i would like to get all the employees belong to the departments. I was trying using the following JPA query
    Select o from EmployeeEntity where o.deparment IN ( :departments ) then set the parameter value to the List of department objects. Now i am getting the following exception
    at org.eclipse.persistence.exceptions.QueryException.invalidOperatorForObjectComparison(QueryException.java:598)
         at org.eclipse.persistence.internal.expressions.RelationExpression.normalize(RelationExpression.java:388)
         at org.eclipse.persistence.internal.expressions.CompoundExpression.normalize(CompoundExpression.java:218)
    Any hit ?
    Thanks

    Hi,
    You can try the following query
    select e from Employees e where e.Departments.departmentid in (:deptno)
    then set the parameter value to the List of departmentid
    Thanks

  • Convert JPA Query getResultList to Array

    I have been struggling with this problem for several hours now. All I have succeeded in doing is attempt every possible way to convert a List into an array and I just get errors.
         // create native SQL query
         Query q = em.createNativeQuery("SELECT * FROM Project p");
         // get and process the results
         List<Project> list = q.getResultList();
            Project[] retVal = new Project[list.size()];
         for (int i = 0; i < list.size(); i++)
             retVal[i] = list.get(i);
         }One would assume this to work, however this generates a ClassCastException, cannot convert Object to Project, oddly because as far as I can see everything in the code is strongly typed. I think Persistence fills the typed List with Object and not Project??
    So I tried:
    Project[] retVal = list.toArray(new Project[0]);This generates an ArrayStoreException.
    Finally I tried the basic, should generate x-lint warning:
    Project[] retVal = (Project[])(list.toArray());This also return ClassCastException, same reason as the first attempt.
    I want my WebService function to return a standard Project[] not the java.lang.List class. But it seems JPA queries only support getting a List. I have googled to no end for a solution. Help appreciated!
    Thanks.

    You are almost right, you can solve this two ways as below:
    First, use native query with result class reference.
    Second, use JPA query with createQuery method.
    Both the options should work, see code below:
    // First option, create native SQL query with result class reference.
    Query q = em.createNativeQuery("SELECT * FROM Project p",Project.class);
    // Second option, Create JPA Query.
    // Query q = em.createQuery("SELECT p FROM Project p");
    // get and process the results
    List<Project> list = q.getResultList();
    // Putting result to an array
    Project[] retVal = new Project[list.size()];
    list.toArray(retVal);*Cheers,
    typurohit* (Tejas Purohit)

  • JPA query by entity/object ?

    I am trying to write an abstract API which dynamically assigns any Entity Class that needs to be persisted and retrieved using the Entity Manager.
    Saving into the database is not a problem, I just do entityManager.save(Class) and it works for any class that needs to be persisted.
    However, when querying for the object based upon the attributes, I want to avoid naming particular attributes and want to use the Entity class's attributes against itself for querying.
    For example, the client program will say something like this to query by name and age of a Person:
    -------calling (client) program: ---
    Person p = << get from UI, not saved yet, no Id but has all other attributes like name and age etc. >>
    List<Person> persons = dao.getAllThatMatch(p);
    --- end client Program --
    --- DAO class ---
    List<T> getAllThatMatch(T t) {  //note that expectation is that returned is a list of Object which is the same as the querying object
    List<T> entityList = em.someFinderMethod(t);
    //the someFinderMethod method should automatically query for all Person objects that match the attributes provided by the object of Person supplied as criteria
    //NOTE: there is no attribute mentioned extensively like name, age etc.
    return entityList ;
    -- end DAO class --
    Edited by: user7626479 on Feb 6, 2013 3:55 PM
    Edited by: user7626479 on Feb 6, 2013 3:55 PM

    Query by example is not included in the JPA standard, but it is possible to do with EclipseLink.
    See http://wiki.eclipse.org/EclipseLink/Examples/JPA/ORMQueries#Query_By_Example
    for how to use query by example with native EclipseLink queries. To execute a native query through JPA, you will need to call createQuery(DatabaseQuery query) on the org.eclipse.persistence.jpa;JpaEntityManager obtained from the javax.persistence.EntityManager instance by calling getDelegate() or unwrap.
    Best Regards,
    Chris

  • What to be targetted by JPA query?

    In JPA the SELECT query is against entity objects, but the UPDATE against DB records, aren't they?
    i coded some basic JPA staff, then found that the getResultList() method to SELECT query always returned the latest states of entity objects but not of DB records, in contrast the executeUpdate() method to UPDATE query always changed the values of DB records but not of entity objects.
    Unfortunately i couldn't prove it from JPA Spec directly. What are the reasons behind? Pls correct me if i were wrong. Thx!
    Edited by: solfan on Jun 24, 2009 3:26 AM

    I suggest you first study and understand fully what the relation between a "transaction", an "entity manager" and a "managed entity" is, before you make any further assumptions.

  • JPA Query.setFirstResult(int) ... What if the table has much more entries

    Hello.
    I want to page my query results but I have a table that has a long primary key. As I see Querry.setFirstResult() can only take an int as a parameter.
    How can I page my results if I have much more than 2,147,483,647 entries? I could implement it by myself... but isn't there some standard way?

    gimbal2 wrote:
    I'd say in theory it is not possible to do that with JPA (or the underlying ORM implementations). Luckily in practice there is no need for such functionality. Who is going to paginate more than 2 billion results?I find it very plausible. Say you have a table that might grow very large ... with A LOT of entries ( more than 2 bilion ) and you want to be able to browse all of them in a client GUI.

  • Coherence+JPA query issues

    Hello everyone,
    I've setup Coherence 3.6 to use JPA according to the generic instructions found here [http://coherence.oracle.com/display/COH35UG/Configuring+Coherence+for+JPA]
    This works fine and I can actually get data out of the DB backed cache. What I've found however is that CohSQL queries do not return anything unless the entry is already in Coherence. I'm using this piece of code to test query Coherence
    public <T> List<T> getAll(Class<T> type) {
            final List<T> data = new ArrayList<T>();
            Filter filter = QueryHelper.createFilter("value().class=?1", new Object[] { type });
            Set<Map.Entry<?, T>> filteredSet = cache.entrySet(filter);
            for (Map.Entry<?, T> t : filteredSet) {
                data.add(t.getValue());
            return Collections.unmodifiableList(data);
      }Should I be expecting Coherence to query the DB at this point, or is CohSQL confined to whatever's already in the cache?
    Thanks
    Edited by: 876420 on 01-Aug-2011 07:07

    Section 20 of the dev guide:
    "It should be noted that queries apply only to currently cached data (and will not use the CacheLoader interface to retrieve additional data that may satisfy the query). Thus, the data set should be loaded entirely into cache before queries are performed. In cases where the data set is too large to fit into available memory, it may be possible to restrict the cache contents along a specific dimension (for example, "date") and manually switch between cache queries and database queries based on the structure of the query. For maintainability, this is usually best implemented inside a cache-aware data access object (DAO)."
    Cheers,
    Steve

  • Jpa query with parameters in Greek

    Hello
    I use netbeans 6.9.1 and toplinlk essensials for jpa connected to a mysql database
    mysql database constants:
    character_set_database = utf8
    character_set_server = utf8
    character_set_system = utf8
    I have this code
    Query qItemom = emOpsw.createQuery("SELECT m FROM Itemom m WHERE "
    + " m.book = :book AND m.omfile = :omfile AND m.omaster = :omaster ");
    qItemom.setParameter("book", (short)1);
    qItemom.setParameter("omfile", (byte)2);
    qItemom.setParameter("omaster", "ΕΚΡ");
    The "omaster" parameter is a String. When i pass latin characters i get results, but when i pass
    a greek character string "ΕΚΡ" for example, i do not get any results at all.
    Can anyone help me?
    Than you in advance.

    Could be a MySQL or JDBC issue. Try the same query using raw JDBC and the bind parameter.
    You could also try disabling parameter binding, if the issue has to do with your JDBC driver's binding.
    James : htttp://www.eclipselink.org

  • How to view SAP JPA query

    Hi All,
    In Hibernate we can see the query by setting in persistence xml file
    <property name="show_sql">true</property>
    Do we have anything like this in SAP JPA so that i can see the actual query ?
    If not is there any place in Server where can I check the fired query?
    Many Thanks

    Hi Arvind,
    You can monitor JPA Cache, for more details please have look of the below help
    Using JPA Monitors - Monitoring - SAP Library
    Thanks,
    Hamendra

  • Where to find the resolved query sent to the database?

    Verison 4.1.1.00.23
    Hello,
    Where/How do I find the actual query that is sent to the database?  I've enabled Debug on the Dev Toolbar, but I still don't see where the query that is sent to the database is at? I'm hoping to see a view with the page items resolved not what is actually in the page.
    I have a query on a collection and I keep getting a 'SQL command not properly ended' error and I'm not seeing why it's not "properly ended".
    Hope this is clear.
    Let me know if not.
    Thanks,
    Joe

    Tony,
    Thank you for replying.
    There is an update -  The query no longer throws the 'SQL command not properly ended', but now it throws the dreaded 'Missing Right Parenthesis' error.
    The query is:
                APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B (p_collection_name => 'TEAM_EMP',
                                                                p_query => 'SELECT cme_system, tbs_team_id, resource_id,
                    CASE WHEN resource_type = ''C'' THEN ''Consultant'' ELSE ''Employee'' END AS resource_type, role,
                    jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, forecast_id, project_id,
                    jan_id, feb_id, mar_id, apr_id, may_id, jun_id, jul_id, aug_id, sep_id, oct_id, nov_id, dec_id,
                    resource_name, tbs_forecast_year.last_updated, last_updated_by.last_updated_by, area_id, p.group_id, team_name,start_date, end_date, p.project_name
                    FROM tbs_forecast_year
                    INNER JOIN (SELECT project_id pid, area_id, tbs_projects.group_id, UPPER(project_name) project_name
                                FROM tbs_projects
                                WHERE status IN (''Pipeline'', ''Planned - Partially Funded'', ''Planned'', ''Execution'')) p
                    ON p.pid = project_id
                    LEFT JOIN (SELECT resource_onepass_id, resource_name last_updated_by
                               FROM resources where resource_onepass_id is not null) last_updated_by
                    ON last_updated_by.resource_onepass_id = tbs_forecast_year.last_updated_by
                    LEFT JOIN tbs_teams ON tbs_teams.team_id = tbs_team_id
                    LEFT JOIN (SELECT resources.resource_id rid, resource_name from resources) resources
                    ON rid = resource_id
                    WHERE (jan > 0 OR feb > 0 OR mar > 0 OR apr > 0 OR may > 0 OR jun > 0 OR jul > 0 OR aug > 0 OR sep > 0 OR oct > 0 OR nov > 0 OR dec > 0)
                    AND forecast_type = ''Supply''
                    AND (project_id = '|| :F189_PROJECT_ID ||' OR 0 = '||:F189_PROJECT_ID ||')
                    AND (tbs_team_id IN (SELECT * FROM the(SELECT cast(vc2_list('|| :F189_TEAM_ID ||') as vc2_list_type) FROM dual))
                        OR 0 IN (SELECT * FROM the(SELECT cast(vc2_list('|| :F189_TEAM_ID ||') as vc2_list_type) FROM dual)))
                    AND (resource_id = '|| :F189_RESOURCE_ID ||' OR 0 = '||:F189_RESOURCE_ID ||')
                    AND (team_name like ''%'|| :F189_TEAM_NAME ||'%'' OR '' '' = '' '||:F189_TEAM_NAME ||''')
                    AND (area_id = '|| :F189_AREA_ID ||' OR 0 = '||:F189_AREA_ID ||')
                    AND NOT (0 = '||:F189_RESOURCE_ID ||' AND 0 = '||:F189_AREA_ID ||' AND 0 IN (SELECT * FROM the(SELECT cast(vc2_list('||:F189_TEAM_ID||') as vc2_list_type) from dual))
                    AND 0 = '||:F189_PROJECT_ID ||' AND '' '' like '' %'||:F189_TEAM_NAME ||'%'')
    Line 22 is calling a function to deal with a Multi-Select list that I found https://community.oracle.com/message/3566187#3566187. I've created the TYPE and the function as indicated in that thread. The error is thrown when multiple Team's are selected.
    The exact error is: create_collection_from_query_b Error:ORA-20104: create_collection_from_query ParseErr:ORA-00907: missing right parenthesis
    There are going to be 4 multi-select lists and TEAM_ID is the first.
    :F189_TEAM_ID is an application item that is being populated from a page process.
    If you have a better solution for dealing with Multi-Select lists I would be very interested in hearing it.
    I've tried the replace and the instr methods with no success. Once the Collection is working then I have to modify the query for the page which is using the APEX_ITEM API's, but I haven't gotten this working yet.
    Thanks Tony!
    Joe

Maybe you are looking for

  • How to do this in bip

    I've a report that has columns like Item, item_desc, total_sales(qty*unit_cost), tran_date etc 101 apples 20 1-jan-2010 101 apples 50 1-jan-2010 102 oranges 30 2-jan-2010 some thing like this I want total_sales of a particular item on a particular da

  • "in" clause in case statement

    Hello, I want to do something like this:      select * from ....         join ....       where ....         and case when pparameter = 'D' then (a.column in ('M', 'P'))                  when pparameter = 'N' then (a.column in ('N', Z'))             e

  • LinkToAction in a Table

    Hi, I have a report shown in a view in form of a table. Suppose the report shows: Purchase order number, Currency and Total Amount. These information comes from a BAPI in SAP. Now when user clicks on the Purchase order number, a view with Purchase or

  • Export without HTML tags

    Hello, I have written my own PL/SQL export to Excel function, basing on Denes' procedure. Unfortunately I'm facing problem with some of my views and columns that contains a lot of text. I show such a data as shorter version of DB content, i.e. "This

  • Workflow Java Mailer - Where is it?

    Hi, I have installed Oracle Workflow Server Release 10.1.0.3 for Linux x86 standalone on a on a 10.1.0.4 database run the configuration assistant. The DAD is configured in the 10G Standalone HTTPD which i installed from the 10.1.0.3 companion CD and