I think it depends on what DBMS you are actually using. For instance, with PostgreSQL, it will not work (or possibly will with the optional 2nd parameter specifying the sequence object?). Fortunately, PostgreSQL allows you to return it as part of the insert query itself by using its RETURNING syntax (which is what we do where I work). If you're using MySQL, you should be okay, as it will presumably be calling MySQL's LAST_INSERT_ID() function.
This only really becomes an issue if/when you want to change the underlying DBMS or are developing an app that you want to be able to use with multiple DB drivers. In that case, you might need to set up some switches or child classes to deal with different DB drivers.