Question: I've got a stored procedure that i'm having some issues with.

I'm trying to lookup against my table `GOTWVotes` and if `VotedBy` hasn't voted before write the vote to the table(this is working) however if `VotedBy` has voted before not to write to the table and return `VoteCount` as 1.

Although it doesn't write to the table when `VotedBy` exists the value of `VoteCount`always appears to be 0

Any help would be appreciated

```
CREATE PROCEDURE [dbo].[Votes]
    @VotedMember BIGINT,
    @VotedBy BIGINT

    AS
    DECLARE @votecount INT

    BEGIN TRY
    BEGIN TRANSACTION t_Transaction
    SELECT TOP 1 * FROM [GOTWVotes] WITH (TABLOCKX)

    SELECT @votecount = COUNT(*) FROM [dbo].[GOTWVotes] 
    WHERE [VotedBy] = @VotedBy
    IF @votecount = 0

    INSERT INTO 
        [dbo].[GOTWVotes] ([VotedMember],[VotedBy])
    VALUES
        (@VotedMember, @VotedBy)
    COMMIT TRANSACTION t_Transaction
    END TRY
    BEGIN CATCH
        SET @votecount = -1
        ROLLBACK TRANSACTION t_Transaction
    END CATCH
        RETURN @votecount

```

Answer: 
Spring uses `jakarta.annotation.PostConstruct`. As a contributor in `spring-cloud-kubernetes`, I have used it and included it in that project numerous times. As a matter of fact we favor *dropping* `InitializingBean`.
Ref <https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-postconstruct-and-predestroy-annotations>

> 
> Like @Resource, the @PostConstruct and @PreDestroy annotation types were a part of the standard Java libraries from JDK 6 to 8. However, the entire javax.annotation package got separated from the core Java modules in JDK 9 and eventually removed in JDK 11. If needed, the javax.annotation-api artifact needs to be obtained via Maven Central now, **simply to be added to the application’s classpath like any other library.**
> 
> 
>