• 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

Getting data which doesn't belong to DataBase

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am facing a strange problem while invoking DataBase using Hibernate Query.I am getting different set of Data and I dont know which dataBase it is pointing.
I am using jBoss application server and below is my oracle-xa-ds.xml configuration.

<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbcracle:thin:@localhost:1521:XE</xa-datasource-property>
<xa-datasource-property name="User">test</xa-datasource-property>
<xa-datasource-property name="Password">test</xa-datasource-property>

In my local data base I am having only 5 data in a table but some times I am getting more than that. .....But I am seeing only OracleServiceXE is running in my local service.Please help me to find out which DataBase exactly it is pointing................

Thanks in Advance............................................
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are using an XA data source, so presumably there is more than one database in your application? Could it just be you are hitting entities that exist in this other database?

You can use Oracle's management view to make sure you are connecting to the database you think you are.
 
Kuts Aryan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.But say for example If I have two DB,their name cant be similar(hence XE).So XE DB should be unique.Please correct me if I wrong.
Also could you tell how can I check the DB connection in Oracle Management view as you mentioned.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very true. I only mention it because, since you are using more than one database (or at least more than one transactional resource) there could be come confusion in your code as to what you are actually querying. I'm assuming you also have more than one SessionFactory? Worth examining, if you haven't already.

The Oracle docs will tell you more, but its stuff like v$session you need to check.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic