I am trying to get JPA (Toplink) configured to run in Jetty being run from the maven plugin and am getting a javax.naming.NameNotFoundException. The specifics.
web.xml:
<persistence-unit-ref>
<persistence-unit-ref-name>persistence/mod</persistence-unit-ref-name>
<persistence-unit-name>ModPU</persistence-unit-name>
</persistence...
public class LoginTest {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("IRCBotPU");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Login lg = new Login();
lg.setPassword("password");
lg.setUserName("Rocky");
em.persist...
Im trying to remove an entity which has a unique PK like : 80253
I remove this entity by doing the follow lines of code:
myEntityType1 = getEntityManager().find(MyEntityType1.class, 80253);
getEntityManager().remove(myEntityType1);
getEntityManager().flush();
These bits of code actually deletes the rows from my database and all its ...
I have a simple CRUD project that I'm using richfaces and toplink for. I've noticed some of the pages are rather slow to load, so I turned the logging level for toplink to FINE. When loading my page that lists all of my course objects in a rich:datatable, toplink appears to be running the same select all query 9 times. When using the r...
Is it possible to do a nested select in JPA QL?
How would I write the following SQL statement in JPA QL?
select * from preferences p left outer join (select * from preferencesdisplay where user_id='XXXX') display on ap.pref_id=display.pref_id;
The JPA entity PREFERENCES has a OneToMany relationship to PREFERENCESDISPLAY. I want to...
Hi all,
I hava 2 objects associate by oneToMany relationship("One Model can have many events").
I'm trying to make a subquery in ejbql to find models for one event, like this:
SELECT model
FROM RegModelValue model
WHERE :event IN (model.events)
....
but toplink doent recognize model alias and tell me "Internal Exception: line 1:12...
I have J2EE Application where I am using JPA/Toplink now I want to implement external or internal connection pool ... please help me to figure out how to implement connection pooling with JPA/TopLink ...
...
As far as I know, JPA itself offers all the shiny features like ORM, JPQL, entity relations mapping and so on. But I don't really understand, why do people use Hibernate or Toplink on top of JPA.
What does Hibernate offer that JPA itself doesn't have?
...
Hi all,
I am using EJB3 on Glassfish using the default TopLink persistance manager. Within a Session Bean, when the persistence manager catches a DB exception, it marks the transaction to be rolled back, and throws an EJBException, in turn wrapping a RollbackException. Now I was expecting to be able to get the original jdbc exception ou...
I have a tomcat 6.0.20, apr 1.2, jdk 1.6.0_15 with mysql 5.1.38 running on a rhel box with 4 GB ram. There is one simple jsp/servlet application on it with 5 users, one struts 1.2.0.9 with 64 users on it and one struts 2.0 application with 35 users on it. The struts 2.0 users make an entry every second, about 900 entries in a day. I am ...
hi, i am using hibernate but i want to add an application that is using hibernate. the problem that i am facing is when i want to perform global transaction on that combined application. i am using weblogic as container, now the problem is that hibernate created its own connection, i want that toplink should use that connection only... c...
i am using a toplink with struts 2 and toplink for a high usage app, the app always access a single table with multiple read and writes per second. This causes a lock_wait_timeout error and the transaction rolls back, causing the data just entered to disappear from the front end. (Mysql's autocommit has been set to one). The exception ha...
i am implementing jpa using toplink, and whenever any sort of error comes in the log file, all db entries after the error DISAPPEAR from the db, all errors are caught in a try, catch statement and sent to an error page, still the data continues to disappear, i call commit() after every transaction, i have not called rollback in the code,...
hi All,
I am using toplink and i need to call one procedure. I tried but i am getting some problem. can anyone help me. Below is the code piece.
public void executeStoredFunction(ServerSession session) {
StoredFunctionCall call = new StoredFunctionCall();
call.setProcedureName("AAA.aabb()");
call.addNamedArgument("abc");
Va...
hi all,
i am facing one problem. I need to update the server session's cache when we say writeChanges in unit of work. As in my application i do not say commit on unit of work instead i say commit on connection which indirectly commits the transaction but does not update the cache.
so can any one tell me how to do that in any of the cas...
hi,
can i directly create unit of work on server session instead of creating multiple client session. As my application runs in multi threaded environment, so i am unable to get updated entity in some different client session so my application fails every now and then.. plz help me.
...
Is there any way i can access the object of one client session from another client session?
...
I try to write an big test class.
I'm using Junit, Hibernate and TopLink and H2 database. Before this I used EJB3Unit (including Hibernate and H2).
My test class has 57 test methods. If I run all test at once randomized one or more test fails. If I run each test alone, I get no error.
Has anyone an idea what's going wrong? And how I c...
hi,
i am using toplink, but i am getting some problem while updating the values. this is my code snippet
ExpressionBuilder builder = new ExpressionBuilder();
Expression expr = builder.get("addressId").equal("2");
Address address1 = (Address)uow.readObject(Address.class, expr);
address1.setPincode(address1.getPincode() + 1);
uow.register...
I'm facing a very complicated problem in my application that is solved when I update from toplink 10.1.3 to toplink 10.1.3.4. Now I must find out which resolved issue (list available here http://www.oracle.com/technology/products/ias/toplink/doc/10131/relnotes/rel_notes.htm#BABBHCAA) is responsible for the solution, so I can convince the...