I have a Content object which refers to a set of Tag objects in a ManyToMany relationship. As part of persisting a new Content object I look in PostgreSQL to see if the Tag alr
change the configuration of your relation in content entity to this:
@JoinTable(name = "content_tag",
joinColumns = @JoinColumn(name = "content_id"),
inverseJoinColumns = @JoinColumn(name="tag_id")
)
This caused by transaction,U can't read uncommitted data, U may commit a transaction after U create a line of 'tag'.