Skip to content

JdbcChatMemory not compatible with MSSQL Server #2807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xchopin opened this issue Apr 19, 2025 · 0 comments
Open

JdbcChatMemory not compatible with MSSQL Server #2807

xchopin opened this issue Apr 19, 2025 · 0 comments

Comments

@xchopin
Copy link

xchopin commented Apr 19, 2025

Bug description

Cannot use JdbcChatMemory with a MSSQL Server

Incorrect syntax near 'LIMIT'.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:270) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1735) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:675) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:594) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7745) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4391) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:276) ~[mssql-jdbc-12.8.1.jre11.jar:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246) ~[mssql-jdbc-12.8.1.jre11.jar:na]

Environment
1.0.0-M7

Steps to reproduce
Add a JdbcChatMemory as an advisor to a ChatClient with a MSSQL Server

Expected behavior
Return the elements

Minimal Complete Reproducible example

// Create a chatclient for example:  
@Bean
	public ChatClient chatClient(ChatClient.Builder builder) {
		return builder.defaultSystem(SYSTEM)
			.defaultAdvisors(new MessageChatMemoryAdvisor(new JdbcChatMemory(JdbcChatMemoryConfig.builder().jdbcTemplate(jdbcTemplate).build())))
				.build();
	}


// then use the chatclient 

chatClient.prompt(prompt).call().content();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant