• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Websphere 7, MySQL, EJB3 & OpenJPA

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please! is there anyone out there who has ever actually written an app using EJB, WAS7/openJPA because I can't get my to work and have been trying for a week to do a simple 'insert' into my database!

I used to use Glassfish with Toplink and everything was fine, apart from the fadct Glassfish isn't very good as an app server. Never deploys or undeploys EArs properly, very slow and generally a pain to work with. So I decided to go back to an old favorite WAS(7 as it is now), only problem is, WAS uses openJPA. Not a problem I thought, maybe a couple of changes but shouldn't be an issue.

Well a week later and I've gotten knowhere! I can not for the life of me see why my app refuses to insert new rows into tables. Well it will insert a new row, but all the data is lost, instead I just get 'NULL' for everything.

I get no errors in my logs, on debugging I see the data is there right upto the point of em.persist(dao), but in the database I just get NULLs!

Also why the hell does my auto_increment column keep starting at 51? Where is this coming from?

I really am at my wits end with this openJPA, uch a simple ask and it's proving to be a hellish nightmare!

KS
 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith..

i think WebSphere 7 support for Toplink and its become easier if you use Toplink in WebSphere, because you've experience with Toplink..
or you indeed need use OpenJPA in your application?..

please correct me if i'm wrong..

Thanks..
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without seeing the relevant code (and some logs) it's difficult to tell what's wrong. If the rows themselves were absent, then i would have thought it to be related to the MySQL engine that you are using (one engine type doesn't support transactions). However, if the rows are present and the column values is null, then it probably has to do something with the code.

Also why the hell does my auto_increment column keep starting at 51?



The initial values are specified at the DB server level. So you will have to check the DB server documentation to see how to set/reset it.
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Thanks for those responses (I forgot I'd posted on here to be honest)
I still haven't got my app working, it creates rows in teh tables but they are blank!

If WAS suppports toplink that would be great, as I don't care what JPA source I use as long as it's working

Do you know where I can find an example of WAS using toplink as I think WAS is built on openJPA so I guess there's some work to do to get it working, or should it just work?

cheers

KS
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, i've never WAS before..
currently, i use Glassfish (the default JPA Provider is TopLink), but perhaps the rules is same....
when i need to use other JPA Provider, such as EclipseLink..
i deploy the libraries required into Glassfish..
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leonardo Carreira wrote:Sorry, i've never WAS before..
currently, i use Glassfish (the default JPA Provider is TopLink), but perhaps the rules is same....
when i need to use other JPA Provider, such as EclipseLink..
i deploy the libraries required into Glassfish..



I was using Glassfih (and this app worked fine) using Toplink, but I changed to Websphere because I found Glassfish so dodgy.
When I redeployed apps I used to get erros and used to have to redploy them like
app1 app2 app3 app4 app4 etc etc etc
So I started using Websphere and that's when I had the problems.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestion..
Yes, sometimes Glassfish made me do a lot of works, sometimes the application deployed in Glassfish suddenly causes "domain" error, and the domain couldn't start ..
i solve the problem with delete the domain-error and then create a new domain with same port as before...
and then i configure ConnectionPooling, etc..

i am interested use Glassfish because its ease to configure //this is my personally opinion

have you tried to deploy Toplink Libraries in WAS 7?..
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leonardo Carreira wrote:Thanks for your suggestion..
Yes, sometimes Glassfish made me do a lot of works, sometimes the application deployed in Glassfish suddenly causes "domain" error, and the domain couldn't start ..
i solve the problem with delete the domain-error and then create a new domain with same port as before...
and then i configure ConnectionPooling, etc..

i am interested use Glassfish because its ease to configure //this is my personally opinion

have you tried to deploy Toplink Libraries in WAS 7?..



I put the toplink.jar into a WAS/lib/ext folder, but I do not know what else needs to be done to get toplink working with WAS. That was the problem I was having, so I started using OpenJPA (WAS default JPA) then I got the problem in the foirst post where I was gettign blank rows in my DB.

I think for now I will go back to Glasssfish for development (as this has delayed me by about 3 weeks now) and worry about changing to WAS later.
I really like WAS7 though, very nice AppServ, probably the best (in my opinion)
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm, how about if you try to use EclipseLink, the complete version of TopLink..
but while you use EclipseLink, you should configure application server target, to get it work..
i've bad experience with it.. when i tried to simple insert into database, the data is couldn't inserted, whereas there's no error..
obviously, the main problem was i forgot to set the application server target configuration in persistence.xml..
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

can anyone update on this

Thanks in Advance,
Rajesh Yarlagadda
reply
    Bookmark Topic Watch Topic
  • New Topic