Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting data which doesn't belong to DataBase

 
Kuts Aryan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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............................................
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic