• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

One BMP for several postgresql tables  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to solve a problem with a BMP which represent many tables in a Postgres database. Each tables have 3 columns : id, name and image.
My problem is when I want to get the lines from a table, the ejbLoad() method is not done by the bean when the id have ever been known before for an other table :
example :
Table1
id=1 ; name=toto ; image=toto.jpg
id=2 ; name=tata ; image=tata.jpg
id=3 ; name=titi ; image=titi.jpg

Table2
id=2 ; name=tutu ; image=tutu.jpg

When I get all lines from Table1, it works fine but when I ask for Table2, it returns : id=2 ; name=tata ; image=tata.jpg instead of id=2 ; name=tutu ; image=tutu.jpg.

Is somebody knows how to force the ejbLoad() to look in the database or knows another solution to solve this problem ???

Thanks a lot for response.
Nicolas
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems in your ejobLoad method you are calling Table1 in both cases. Please check to make sure your query calls Table2.

Sudhir
 
Nicolas Taillepied
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sudhir, I'm sure not to call Table1 in both cases because if I call first Table2 the response is : id=2 ; name=tutu ; image=tutu.jpg
And after if I call Table1 :
id=1 ; name=toto ; image=toto.jpg
id=2 ; name=tutu ; image=tutu.jpg
id=3 ; name=titi ; image=titi.jpg
I've check the problem, it comes from that ejbLoad() is not made when the id was asked before.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!