标签: amazon-aurora

Spring Data JPA:DML操作不支持

我已经为Amazon Aurora数据库编写了一个查询,以在我的接口CrudRepositoryExtended中删除一些对象,但是当我执行该查询时,它将引发异常!

@Transactional
@Query("delete from HotelPrice hp where hp.updateDate < ?1 ")
void deletePriceOlderThan   (Date date);
Run Code Online (Sandbox Code Playgroud)

异常跟踪跟踪:

Caused by: java.lang.IllegalStateException: org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for DML operations [delete from com.gamesa.backend.persistence.domain.backend.HotelPrice hp where hp.updateDate < ?1 ]
    at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:554)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:208)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:87)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:116)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:106)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:499)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
    ... 35 common frames omitted
Run Code Online (Sandbox Code Playgroud)

jpql spring-data spring-data-jpa spring-boot amazon-aurora

0
推荐指数
1
解决办法
1943
查看次数

AWS RDS aurora Mysql 5.6 无法使用与默认引擎不同的引擎创建表

问题:无法在 AURORA MySQL 5.6 RDS 上使用 MyISAM 存储引擎创建表

配置:

我有RDSAurora MySQL 5.6.10a.

default_storage_engine设置为InnoDB且无法修改 ( Modifiable = false)。

当我运行命令时

SHOW ENGINES
Run Code Online (Sandbox Code Playgroud)

我收到:

+----------+---------+-------------------------+--------------+------+------------+
| Engine   | Support | Comment                 | Transactions | XA   | Savepoints |
+----------+---------+-------------------------+--------------+------+------------+
| 'MyISAM' | 'YES'   | 'MyISAM storage engine' | 'NO'         | 'NO' | 'NO'       |
+----------+---------+-------------------------+--------------+------+------------+
Run Code Online (Sandbox Code Playgroud)

我的目标:

创建带有MyISAM搜索引擎的表。

会发生什么:

当我尝试使用命令创建表时:

CREATE TABLE `myTable` (
  `myTableId` int(11) NOT NULL AUTO_INCREMENT,
  `latLong` point NOT NULL,
  `createdAt` …
Run Code Online (Sandbox Code Playgroud)

mysql myisam amazon-web-services amazon-rds amazon-aurora

0
推荐指数
1
解决办法
3417
查看次数

我是否为工作选择了错误的数据库?DynamoDB 与 Aurora

我正在建立一个房地产网站,其中包含房产列表、一些搜索过滤器和一个带有自动完成功能的地址字段。它工作正常,但自动完成性能非常慢。几乎需要一秒钟才能得到回应。考虑到所有服务都在我所在的地区,我认为这很慢。

我即兴进行了一种“模糊”搜索,我在其中拆分了源字符串(例如,如果用户搜索“Jumeirah, Rimal”变为 [“jumeirah”, “rimal”])并尝试匹配某个位置的完整“路径”(一个像 locationID/city/community/sub-community/tower 这样的字符串,在这个例子中是“are.1.50/Dubai/Jumeirah Beach Residence/Rimal”)到分割字符串的每个部分。表达式变成这样:

contains(#path, :fullString) OR 
(contains(#path, :stringOne) AND contains(#path, :stringTwo) AND ... )
Run Code Online (Sandbox Code Playgroud)

重要的是,因为我需要使用“包含”运算符,所以我不能用 KeyExpression 有效地完成它,我需要使用较慢的 FilterExpression 进行完整扫描。我只有 7,500 个位置可供搜索,而且性能已经很差了。

这让我思考是否应该使用像 Aurora 这样的基于 SQL 的数据库。AFAIK SQL 可以非常高效地执行复杂的查询。

我还将研究 AWS 的弹性搜索解决方案。

你怎么认为?

amazon-web-services amazon-dynamodb amazon-aurora dynamodb-queries

0
推荐指数
1
解决办法
309
查看次数

-5
推荐指数
1
解决办法
4749
查看次数