Page 1 of 1

Signup Assistance - MSSQL Support

Posted: 07 Nov 2013, 04:25
by Zanpher
Currently, I do not believe the Signup Assistance is compatible with MSSQL.

The following error happens with the correct table format. Please note that the record is created in MSSQL just fine, even though the server throws the following error message:

18:51:51,773 INFO [main] v2.SmartFoxServer - SmartFoxServer 2X (2.7.0) READ
Y!
18:52:31,048 INFO [SocketReader] sessions.DefaultSessionManager - Session c
reated: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:6111 } on Server port:
9933 <---> 6111
18:52:31,087 INFO [pool-1-thread-3] api.SFSApi - User login: { Zone: Osinia
}, ( User Name: Guest#0, Id: 0, Priv: 0, Sess: 127.0.0.1:6111 ) , Type: Unity
18:52:31,119 WARN [com.smartfoxserver.v2.controllers.ExtensionController-1] sig
nup.SignUpAssistant - java.lang.ClassCastException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.ClassCastException
Message: java.math.BigDecimal cannot be cast to java.lang.Long
Description: Unexpected exception occurred during the SignUp process
User info: ( User Name: Guest#0, Id: 0, Priv: 0, Sess: 127.0.0.1:6111 )
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.components.signup.SignUpAssistantComponent.writeToDatabase
(SignUpAssistantComponent.java:454)
com.smartfoxserver.v2.components.signup.SignUpAssistantComponent.handleSubmit(Si
gnUpAssistantComponent.java:318)
com.smartfoxserver.v2.components.signup.SignUpAssistantComponent.handleClientReq
uest(SignUpAssistantComponent.java:152)
com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.j
ava:208)
com.smartfoxserver.v2.controllers.ExtensionController.processRequest(ExtensionCo
ntroller.java:143)
com.smartfoxserver.bitswarm.controllers.AbstractController.run(AbstractControlle
r.java:96)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Re: Signup Assistance - MSSQL Support

Posted: 12 Nov 2013, 22:20
by Zanpher
Hello,

I was wondering if these modules (signup assistance, verification) will have MSSQL support, or will we need to code our own?

Re: Signup Assistance - MSSQL Support

Posted: 13 Nov 2013, 08:33
by Lapo
I have already replied to you in another thread.
I suggested to change the database key type to a regular integer (INT). Only 32 and 64 bit Integers are supported, "BigDecimal" is not. None of the "Big"-Something are.
Please do that and report your findings.
Thanks

( For the record my previous reply was here: viewtopic.php?p=71463#p71463 )

Re: Signup Assistance - MSSQL Support

Posted: 16 Nov 2013, 04:00
by Zanpher
Only regular INT are used in my code and database. I double checked just now at home.

Re: Signup Assistance - MSSQL Support

Posted: 16 Nov 2013, 08:14
by Lapo
The fact that there's an error caused by the conversion of a BigDecimal is indicative that a key with the wrong type is returned.
Maybe there are several keys in the DB table and the Component expects the record ID to be the first one.
Can you show me a structure dump of the table?

Re: Signup Assistance - MSSQL Support

Posted: 17 Nov 2013, 19:24
by Zanpher
No problem:

Code: Select all

CREATE TABLE [dbo].[account](
   [accountId] [int] IDENTITY(1,1) NOT NULL,
   [email] [varchar](50) NOT NULL,
   [password] [varchar](50) NOT NULL,
   [createdDate] [datetime] NOT NULL,
   [lastDate] [datetime] NOT NULL,
   [username] [varchar](50) NOT NULL,
 CONSTRAINT [PK_account] PRIMARY KEY CLUSTERED
(
   [accountId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Re: Signup Assistance - MSSQL Support

Posted: 17 Nov 2013, 21:02
by Lapo
Thanks. The reason why a BigDecimal is returned is beyond me. I am not an MSSQL expert either, but this kind of problem seems to arise at the JDBC driver level.
I'll see if I can install a local MSSQL instance and get to the bottom of it.