# Why can I not see database records during a Unit Test (when I use a breakpoint)

**URL:** <https://www.ruby-forum.com/t/why-can-i-not-see-database-records-during-a-unit-test-when-i-use-a-breakpoint/140535>\
**Category:** Rails\
**Created:** [June 15, 2008, 11:38pm UTC](https://www.ruby-forum.com/t/why-can-i-not-see-database-records-during-a-unit-test-when-i-use-a-breakpoint/140535 "2008-06-15T23:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [June 15, 2008, 11:38pm UTC](https://www.ruby-forum.com/t/why-can-i-not-see-database-records-during-a-unit-test-when-i-use-a-breakpoint/140535/1 "2008-06-15T23:38:40Z")

</div>

Hi,  
I’m getting into Unit Testing, however I’ve noted when I am using a  
breakpoint (with NetBeans IDE) half way through a unit test, although in  
the  
Unit Test it has already successfully created some rows, when I look  
directly in the database I can’t see them?

Q1 - Why is this?  
Q2 - If this is normal, how can I fault find my unit test code itself?  
I’m  
assuming that the database gets cleaned up at the beginning and end of  
each  
test case so thats why I was wanted to see progress in the database  
during  
the unit test (via using breakpoints).

Regards  
Greg

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [June 16, 2008, 9:55am UTC](https://www.ruby-forum.com/t/why-can-i-not-see-database-records-during-a-unit-test-when-i-use-a-breakpoint/140535/2 "2008-06-16T09:55:23Z")

</div>

On Jun 15, 10:37 pm, “Greg H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> the unit test (via using breakpoints).  
> each test is run in a transaction (so that changes to the database  
> made by the test are rolled back). The default transaction isolation  
> level on most databases means that you cannot see the results of an  
> uncommitted transaction. You can change this, or just ruby code from  
> your breakpoint (eg if you want to look at account with id 25 just  
> look at Account.find(25))

Fred
