It all depends how long it takes to execute the query you are doing? How much data are you pulling with that query. It is possible that your transaction is taking too long. You should be able to determine that based on your database configuration, each database has different way of configuring that.
In any case I would look into why your transaction is staying so open, from a business point of view.
Cheers,
Filip