10 # Set up the "usual" sqlite for DBICTest
11 my $schema = DBICTest->init_schema;
13 # Make sure we're connected by doing something
14 my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
15 cmp_ok(@art, '==', 3, "Three artists returned");
17 # Disconnect the dbh, and be sneaky about it
18 $schema->storage->_dbh->disconnect;
20 # Try the operation again - What should happen here is:
21 # 1. S::DBI blindly attempts the SELECT, which throws an exception
22 # 2. It catches the exception, checks ->{Active}/->ping, sees the disconnected state...
23 # 3. Reconnects, and retries the operation
25 my @art_two = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
26 cmp_ok(@art_two, '==', 3, "Three artists returned");