If I understand the spec correctly, the data is not guaranteed to be written to the data store (or IDs generated) when EntityManager.persist() is called. If you need the ID immediately after, you will need to call EntityManager.flush() to force the persistence provider to write the data to disk, then you should be able to call sucursal.getIdSucursal().
[Message sent by forum member 'jdlee' (jdlee)]
http://forums.java.net/jive/thread.jspa?messageID=257501