How to find all logged in users in grails application

In this tutorial we assume that we already have grails application with Spring Security core plugin installed. We will explore how to retrieve currently logged-in users using the SessionRegistry. What is SessionRegistry? Maintains a registry of SessionInformation instances. Inject sessionRegistry as a bean in resources.groovy as follows import org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy import org.springframework.security.web.session.ConcurrentSessionFilter import org.springframework.security.core.session.SessionRegistryImpl beans =Read More…

Categories: Grails
Share:

Bulk Insert with Grails GORM

Background: Sometimes we need to insert large number of rows to the database. (For example: transferring data from external source to our database). It is preferable that performance is fast and the expected time to finish is proportional to the number of rows to be inserted. If you’re doing much more frequent imports, with heavyRead More…

Categories: Grails
Share:

Preventing a cycle while creating a tree

Background : In our application we are using a tree structure for representing some logic. The tree may contain another tree as a child node. The requirement was to parse the complete tree  structure by traversing it. While traversing the tree, if a child node refers to another tree, we have to parse this childRead More…

Categories: Grails
Share: