My crystal ball tells me you are running MS Access as your database and using the
jdbc dbc bridge as the driver.
Immediately after the insert and before you close the Connection, do a dummy select (ie select * from THE_SAME_TABLE where uid="")
If this is the problem you are having, it will fix the problem where the Driver caches queries and doesn't send them till the next one arrives.
This is only a guess! You're problem might be completely unrelated, in which case you'd have to drop some sample code for us to look at.
DON'T post the whole thing!, just the important bits.
Dave