For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 9 replies, 3 voices, and was last updated 18 years, 5 months ago by
Riyad Kalla.
-
AuthorPosts
-
Klaus VillacaMemberHello, I’m trying the JPA from the MyEclipse 5.5M2, and I’ve found some problems, like this kind off error, and what I’ve to do to fix this. Is only a test
Here is my XML :
<?xml version=”1.0″ encoding=”UTF-8″?>
<persistence xmlns=”http://java.sun.com/xml/ns/persistence”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd” version=”1.0″><persistence-unit name=”persistence1″ transaction-type=”RESOURCE_LOCAL”>
<provider>mysql.toplink.essentials.PersistenceProvider</provider>
<class>entity.Login</class>
<class>entity.Client1</class><properties>
<property name = “toplink.jdbc.driver” value = “com.mysql.jdbc.Driver”/>
<property name = “toplink.jdbc.url” value = “jdbc:mysql://127.0.0.1:3306/client”/>
<property name = “toplink.jdbc.user” value = “root”/>
<property name = “toplink.jdbc.password” value = “test”/>
</properties>
</persistence-unit>
</persistence>Part of client program client :
// Create EntityManagerFactory for persistent unit named “pu1”
// to be used in this test
emf = Persistence.createEntityManagerFactory(“persistence1”);// Persist all entities
createTransactionalEntityManager();
System.out.println(“Inserting Customer and Orders… ” + testInsert());
closeTransactionalEntityManager();
.
.
.May 17, 2007 at 10:18 am #270227
Riyad KallaMember<provider>mysql.toplink.essentials.PersistenceProvider</provider>
The problem is your persistence provide is invalid… it should be something like:
oracle.toplink.essentials.PersistenceProviderMay 17, 2007 at 3:29 pm #270272
Klaus VillacaMemberOk Tnhks
However now I’d have another problem… I’d can get connected on my MySQL, but I just can do the insert of new records, and use the findid, all the other issues like delete, update, doesnt work. And the strange is, after I did the delete, the programa show to me that are all fine, and if I’d try one another findid he throw one erro to me, but after I go and check on the database, the register still there!!!
Thank youMay 17, 2007 at 3:57 pm #270274
Riyad KallaMemberIt sounds like you need to make use of transactions with your inserts and deletes. It looks like:
EntityManagerHelper.beginTransaction(); <YOUR SAVE or DELETE OPERATION> EntityManagerHelper.commit();May 17, 2007 at 8:40 pm #270283
Klaus VillacaMemberMan,
I`m really have to say thank you. I know that I`’m young on this API, and I`d still a lot to learn and I`d either know that is a stupid thing.
Once again thank you.May 17, 2007 at 8:55 pm #270284
Riyad KallaMemberNo problem. Using persistence APIs (this can happen with hibernate too) has some little “quirks” to it, but once you figure them out you can just start banging out the persistence code without much of a problem.
The first time I ever ran into that issue “why aren’t my values changing!?” it took me a lot of crazy to figure out I needed transactions 😉
October 31, 2007 at 3:33 pm #277854
Robert JewettMemberThis message has not been recovered.
November 1, 2007 at 12:49 pm #277896
Riyad KallaMemberThis message has not been recovered.
November 1, 2007 at 3:00 pm #277905
Robert JewettMemberThis message has not been recovered.
November 5, 2007 at 8:39 am #277987
Riyad KallaMemberThis message has not been recovered.
-
AuthorPosts
