serialize java object DataRow

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
Jipii
Posts: 72
Joined: 18 Aug 2008, 08:53
Location: Frankfurt, Germany

serialize java object DataRow

Post by Jipii »

Hello,

I try to serialize my game room object with all cards, scores and so on, to rebuild situation in which bugs occurs.
I get a NotSerializableException, because some attributes have the type DataRow.
How can I serialize them?

Is it a good solution to write a new class like this:

Code: Select all

package poker;

import java.io.Serializable;

import it.gotoandplay.smartfoxserver.db.DataRow;

public class DataRowSerializer extends DataRow  implements Serializable
{

}
But then I will get a ClassCastException if I try to assign query results to a new object DataRowSerializer .
:?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Looks like DataRow isn't serializable, thus the class cast exception.

You may have to convert all variables of type DataRow into something else before serializing your game room. Possibly as type Map? There is a method to fetch the data as map --> DataRow.getDataAsMap()
Smartfox's forum is my daily newspaper.
Post Reply