doulun1939 2009-11-01 22:15
浏览 18

我的数据库没有立即插入

I am a trying to apply Test Driven Development to producing a web page and am having trouble using my database. I am developing using Cake 1.1, PHP5 and SimpleTest to unit test.

My problem is that I have a test that:

  1. Inserts a row using a direct SQL statement
  2. Tests if that row was inserted (by using a function in my main program.)
  3. Deletes the row that was inserted.

Both steps 1 and 3 work fine but step 2 fails.

It's important to realize that if I run the test without deleting the row (I commented that out) and then ran the test again but first eliminating step 1 (once again simply commenting that line) and the test passed without a problem.

I also tried running the SQL statements directly (one after another in the editor) in PHPMyAdmin and they work perfectly.

  • 写回答

3条回答 默认 最新

  • douque8861 2009-11-01 22:20
    关注

    Are all steps executed in the same transaction?

    When not, step 2 isn't able to see the result of step 1 until step 1 commits.

    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)