im using sfs2x-core.jar and sfs2x.jar from smartfoxserver2X 2.16
I notice DBManager.executeInsert() doesn't return a key even it added the row on my mysql database.
meaning DBManager.executeInsert() return null. but when you look at your table, it successfully inserted the row.
i also notice the problem occurs when you insert the data on a table with a primary key is not set to "auto increment"
test 1 # primary key is set to auto increment
row added successfully.
DBManager.executeInsert() returns the key.
test 2 # primary key is not set to auto increment
row added successfully.
DBManager.executeInsert() returns null.
sometimes our primary key is not set to auto increment, because of database normalization.
Edit:
i realize 'auto increment' on table is really needed when using DBManager.executeInsert() to get the generated key.
DBManager.executeInsert() not returning a key even It added a row on mysql database
Re: DBManager.executeInsert() not returning a key even It added a row on mysql database
Hi,
if you don't use the auto-increment feature, you're deciding what key to use and therefore you don't need the database call to return it. (Because you already know its value)
Cheers
if you don't use the auto-increment feature, you're deciding what key to use and therefore you don't need the database call to return it. (Because you already know its value)
Cheers
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 55 guests