diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/MessagesService.java | 2 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java | 6 |
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 284b2018d..cad0f860b 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 5c2701ebb..a19878d98 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; + } } |