aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-02-28 14:29:05 +0300
committerGravatar Vitaly Takmazov2017-02-28 17:16:56 +0300
commit3b460c49a7cbca72f367bc44ca111b2a508d0cac (patch)
tree8346348d2d6970394bb56f81b6886d43dd6fcb53 /juick-server/src/main/java/com/juick
parent38a5c62973e5de2d1f8f6ed8f08c87622d3324ac (diff)
readonly mode
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/service/MessagesService.java2
-rw-r--r--juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/MessagesService.java b/juick-server/src/main/java/com/juick/service/MessagesService.java
index 284b2018..cad0f860 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesService.java
+++ b/juick-server/src/main/java/com/juick/service/MessagesService.java
@@ -81,4 +81,6 @@ public interface MessagesService {
List<Integer> getLastMessages(int hours);
List<ResponseReply> getLastReplies(int hours);
+
+ boolean isReadonly();
}
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
index 5c2701eb..a19878d9 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -767,4 +767,10 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
return reply;
}, -hours);
}
+
+ @Transactional(readOnly = true)
+ @Override
+ public boolean isReadonly() {
+ return getJdbcTemplate().queryForObject("SELECT @@global.read_only", Integer.class) > 0;
+ }
}