EBean with MSSQL 2019

151 views
Skip to first unread message

Nelson Sharpe

unread,
May 19, 2020, 1:35:19 AM5/19/20
to Ebean ORM
Good evening,

I'm just curious about EBean's support for MSSQL Server 2019. This is the version I have access to, but it seems all references in the docs lead me to believe it is not supported. I tried switching my platform to "sqlserver17" like the docs say, but it seems the differences between MSSQL 2017 and 2019 are too large for EBean. I can connect to the database, but all of my ORM queries give me "Incorrect Syntax" errors.

My model is not complex, and neither is my request.

Model:
@Entity @Table(name = "User", schema = "dbo")
public class User extends Model
{
   
@Id @Column(name = "UniqueId", columnDefinition = "VARCHAR(36)")
    UUID uuid
;

   
@NotNull @Column(name = "Name")
   
String name;

   
// Constructor

   
// Getters and Setters

}

Request:
User user = new User(UUID.randomUUID(), "Named User");
user
.save();

Not sure if support is planned for the 2019 version, or if my issue is even related to that at all.

Thanks,
Nelson Sharpe




Rob Bygrave

unread,
May 20, 2020, 4:50:27 AM5/20/20
to ebean@googlegroups
> ORM queries give me "Incorrect Syntax" errors.

You need to give more specific information like the actual SQL executed and the actual error message.  I can't really say much without that except that it is I am unaware of breaking changes in sqlserver 2019.

Cheers, Rob.

--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/7212fba3-1b73-4117-a801-9777eb717be7%40googlegroups.com.

Nelson Sharpe

unread,
May 21, 2020, 3:29:54 PM5/21/20
to Ebean ORM
Hi Rob,

Here are some specifics:
(Note: I use EBean as my DB management tool for a Minecraft Server, but that's not important. I say this to explain some of the info in the stacktraces below.)

For the manual query:
List<User> users = DB.getDefault().createQuery(User.class, "select UniqueId, Name from User").findList();

I get the following stacktrace:
[15:18:14] [Server thread/ERROR]: Error occurred while enabling DatabaseManager v0.0.1 (Is it up to date?)
java
.lang.IllegalArgumentException: line 1:22 mismatched input 'from' expecting {<EOF>, 'where', 'order', 'limit', 'fetch'}
        at io
.ebeaninternal.server.grammer.EqlParser$ErrorListener.syntaxError(EqlParser.java:48) ~[?:?]
        at org
.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) ~[?:?]
        at org
.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544) ~[?:?]
        at org
.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:327) ~[?:?]
        at org
.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139) ~[?:?]
        at io
.ebeaninternal.server.grammer.antlr.EQLParser.select_statement(EQLParser.java:255) ~[?:?]
        at io
.ebeaninternal.server.grammer.EqlParser.parse(EqlParser.java:30) ~[?:?]
        at io
.ebeaninternal.server.core.DefaultServer.createQuery(DefaultServer.java:993) ~[?:?]
        at io
.ebeaninternal.server.core.DefaultServer.createQuery(DefaultServer.java:156) ~[?:?]
        at me
.noeffort.databasemanager.DatabaseManager.onEnable(DatabaseManager.java:35) ~[?:?]
        at org
.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:464) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:378) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.craftbukkit.v1_15_R1.CraftServer.reload(CraftServer.java:835) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.Bukkit.reload(Bukkit.java:620) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:723) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchServerCommand(CraftServer.java:708) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at net
.minecraft.server.v1_15_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:443) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at net
.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:407) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at net
.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:984) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at net
.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:824) [spigot.jar:git-Spigot-6de3d4b-796eb15]
        at java
.lang.Thread.run(Thread.java:830) [?:?]

For my Type-Safe Query using EBean's QueryBeans, I use this statrment:
User user = new QUser().uuid.equalTo(UUID.fromString("7ECCDB9B-6E16-478F-A5BA-7828E83A7AB5")).findOne();

And the following stacktrace is generated:
[15:14:40] [Server thread/ERROR]: Could not load 'plugins\DatabaseManager-1.0-SNAPSHOT.jar' in folder 'plugins'
...
Caused by: java.lang.IllegalStateException: No service implementation found for interface io.ebean.service.SpiRawSqlService
        at io
.ebean.XServiceProvider.loadFirstService(XServiceProvider.java:39) ~[?:?]
        at io
.ebean.XServiceProvider.initRawSql(XServiceProvider.java:27) ~[?:?]
        at io
.ebean.XServiceProvider.<clinit>(XServiceProvider.java:16) ~[?:?]
        at io
.ebean.ProfileLocation.create(ProfileLocation.java:16) ~[?:?]
        at me
.noeffort.databasemanager.DatabaseManager._$initProfileLocations(DatabaseManager.java:1) ~[?:?]
        at me
.noeffort.databasemanager.DatabaseManager.<clinit>(DatabaseManager.java:4) ~[?:?]
        at java
.lang.Class.forName0(Native Method) ~[?:?]
        at java
.lang.Class.forName(Class.java:416) ~[?:?]
        at org
.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:git-Spigot-6de3d4b-796eb15]
        at org
.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:git-Spigot-6de3d4b-796eb15]
       
... 14 more

Not quite sure what this means, there isn't much online about it.

Thanks,
Nelson Sharpe

On Wednesday, May 20, 2020 at 4:50:27 AM UTC-4, Rob Bygrave wrote:
> ORM queries give me "Incorrect Syntax" errors.

You need to give more specific information like the actual SQL executed and the actual error message.  I can't really say much without that except that it is I am unaware of breaking changes in sqlserver 2019.

Cheers, Rob.

On Tue, 19 May 2020 at 17:35, Nelson Sharpe <nelson...@gmail.com> wrote:
Good evening,

I'm just curious about EBean's support for MSSQL Server 2019. This is the version I have access to, but it seems all references in the docs lead me to believe it is not supported. I tried switching my platform to "sqlserver17" like the docs say, but it seems the differences between MSSQL 2017 and 2019 are too large for EBean. I can connect to the database, but all of my ORM queries give me "Incorrect Syntax" errors.

My model is not complex, and neither is my request.

Model:
@Entity @Table(name = "User", schema = "dbo")
public class User extends Model
{
   
@Id @Column(name = "UniqueId", columnDefinition = "VARCHAR(36)")
    UUID uuid
;

   
@NotNull @Column(name = "Name")
   
String name;

   
// Constructor

   
// Getters and Setters

}

Request:
User user = new User(UUID.randomUUID(), "Named User");
user
.save();

Not sure if support is planned for the 2019 version, or if my issue is even related to that at all.

Thanks,
Nelson Sharpe




--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eb...@googlegroups.com.

Nelson Sharpe

unread,
May 22, 2020, 4:07:55 PM5/22/20
to Ebean ORM
A quick update:

I enabled logging and got normal, manually typed queries to work. We can ignore the first issue and its respective stacktrace in the previous message. However, whenever I use QueryBeans, it still gives me some issues (same error, same code).

To recap, the following work:
- Finders
- Manual Queries

The following don't work:
- QueryBeans

Thanks again,
Nelson Sharpe

Rob Bygrave

unread,
Aug 4, 2020, 6:09:54 AM8/4/20
to ebean@googlegroups
> IllegalStateException: No service implementation found for interface io.ebean.service.SpiRawSqlService

Something is weird with the classloader in your environment.

To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/2e07d27b-ab20-4cc8-8f37-7822777bff6f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages