473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Database related exception - GenericADOException

I'm currently trying to test my program, but I keep running into database related error.

Expand|Select|Wrap|Line Numbers
  1. NHibernate.Exceptions.GenericADOException: could not execute query ........ System.Transactions.TransactionException: The operation is not valid for the state of the transaction.
I've searched everywhere online, as much asI could. I get different solutions pop up everywhere. But can't seem to be able to apply it to my problem. Not even sure if they share the issues I have.
Any ideas why I could be getting this error?
Background: (Narrowing it down to the surrounding issues - following the stack trace.) My application has a lot of modules/classes talking to each other. One class is responsible for populating the a DTO (data transfer object) with data obtained from other methods. All this within a foreach loop.
It is very likely the loop is iterating over 1000 items. As a result, I felt maybe the database connection is timing out - not sure.
But every time, I get this error

Expand|Select|Wrap|Line Numbers
  1. NHibernate.Exceptions.GenericADOException: could not execute query
  2. [ select TOP (1)  roleinfoin0_.InfoId as InfoId106_, roleinfoin0_.RoleId as RoleId106_, roleinfoin0_.EntityId as     EntityId106_, roleinfoin0_.Info as Info106_ from EntityRoleInfo roleinfoin0_, RoleAdditionalInfo roleinfo1_, RoleDef     roledef3_ where roleinfoin0_.RoleId=roleinfo1_.RoleId and roleinfoin0_.InfoId=roleinfo1_.InfoId and     roleinfo1_.RoleId=roledef3_.RoleId and roleinfoin0_.EntityId=? and roleinfo1_.Prompt=? and     roledef3_.RoleDescription=? ]
  3.   Name:p1 - Value:120  Name:p2 - Value:Date of Birth  Name:p3 - Value:Client
  4. [SQL: select TOP (1)  roleinfoin0_.InfoId as InfoId106_, roleinfoin0_.RoleId as RoleId106_, roleinfoin0_.EntityId as     EntityId106_, roleinfoin0_.Info as Info106_ from EntityRoleInfo roleinfoin0_, RoleAdditionalInfo roleinfo1_, RoleDef     roledef3_ where roleinfoin0_.RoleId=roleinfo1_.RoleId and roleinfoin0_.InfoId=roleinfo1_.InfoId and     roleinfo1_.RoleId=roledef3_.RoleId and roleinfoin0_.EntityId=? and roleinfo1_.Prompt=? and     roledef3_.RoleDescription=?] ---> System.Transactions.TransactionException: The operation is not valid for the state     of the transaction.
  5.    at System.Transactions.TransactionState.EnlistVolatile(InternalTransaction tx, IEnlistmentNotification     enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
  6.    at System.Transactions.Transaction.EnlistVolatile(IEnlistmentNotification enlistmentNotification,     EnlistmentOptions enlistmentOptions)
Please guys, what am I possibly doing wrong. You should know that when I run that code (the method it crashes at) in isolation via test, it works fine.
Thanks in advance.
May 6 '18 #1
0 1565

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Cpt. Zeep | last post by:
Although this is not strictly PHP related question, i presume lots of you are good in MySql so maybe you could help me. I am making sort of yellowpages application and have following issue: I...
0
by: Rujuta Gandhi | last post by:
Hi All, I used the OdbcConnection, OdbcCommand.ExecuteNonQuery() to update the timesten database. It gives the following error. ERROR Driver does not support this function Eventhough it...
2
by: Martin Arvidsson | last post by:
Hi! I am going to build my firs Windows Application that involves a Database. Now this database and its tables are quite large so i got a couple of quizes regarding performance etc just to get...
7
by: prashantunleashed | last post by:
Hi friends, This is a sincere request to all of you guys..I need help First time When I login into a page,it is succeded, after that i changed the url to the previous one and try to login once...
7
by: cyberbilly1 | last post by:
Hi All! I'm trying to connect to a remote oracle database using the OracleConnection within VB.net . Whenever I try connecting I get a SocketException:No connection could be made because the...
2
by: frankiefrank | last post by:
I have been struggling with this issue for some time, hope someone here can help out. After facing the issue (will describe it soon) in a solution with Ajax and a Master Page I decided to try it...
9
Vini171285
by: Vini171285 | last post by:
Hi, Actually i am filling a list box from database and depending on change in that list box ,the value corresponding to that selected index should come in the textbox,which should come from another...
4
by: QC | last post by:
Hi Friends, I have one Application running on Client PC, i coded to store all Debug, Info, and Trace related information in Log file. This log file helps me to analyze the exception if any...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.